Allow customize media default title

  1. jandry


    It would be great to be able to apply some filter to the default media title to avoid a lot of painful job after upload.
    For exemple remove the added - when filename was created, capitalize first letter, trim, remove pic prefix number, ...
    May be just a plugin hook

    It will be great to be able to add it to the excerpt field also.

    I did my personal hack in wp-admin/includes/media.php->media_handle_upload

    After EXIF management
    // If begin with 00- remove it
    $title = preg_replace('/[0-9][0-9]-/', '', $title);
    // Replace - by spaces (to revert automatic file naming)
    $title = preg_replace('/-/', ' ', $title);
    // Capitalize first letter
    $title = ucfirst($title);

    Then in // Construct the attachment array
    I added
    'post_excerpt' => $title,

    Posted: 9 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.

  • Rating

    2 Votes
  • Status

    This is plugin territory