Title: Feature request
Last modified: March 23, 2021

---

# Feature request

 *  [shawfactor](https://wordpress.org/support/users/shawfactor/)
 * (@shawfactor)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/feature-request-856/)
 * Your plugin is great as is.
 * But one feature I think t needs is that in the absence of a date in the exif 
   data it should also look at the file name (many images have the date coded into
   the file name, e.g. 20191120_183022.jpg)
 * Could you try extracting that date that way as well as a fallback?
 * Alternatively if you do not want to add that feature could you please add a filter(
   maybe around line 85 of the main plugin class) so that I could add that logic
   myself without potentialy updating the image twice?

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Katsushi Kawamori](https://wordpress.org/support/users/katsushi-kawamori/)
 * (@katsushi-kawamori)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/feature-request-856/#post-14220841)
 * Thanks feedback.
    That’s an interesting idea. I’ll try it. Please wait a while.
 *  Plugin Author [Katsushi Kawamori](https://wordpress.org/support/users/katsushi-kawamori/)
 * (@katsushi-kawamori)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/feature-request-856/#post-14222576)
 * Ver 1.04 Added filter.
 *     ```
       /**  ==================================================
        * Sample snippet for Upload Media Exif Date
        *
        * The original filter hook('umed_postdate'),
        * Get the date and time from the file name when the date and time cannot be read from the EXIF.
        *
        * @param string $filename  filename.
        */
       function umed_postdate_from_filename( $filename ) {
   
           /* Sample for 20191120_183022.jpg */
           $year = substr( $filename, 0, 4 );
           $month = substr( $filename, 4, 2 );
           $day = substr( $filename, 6, 2 );
           $hour = substr( $filename, 9, 2 );
           $minute = substr( $filename, 11, 2 );
           $second = substr( $filename, 13, 2 );
   
           $postdate = $year . '-' . $month . '-' . $day . ' ' . $hour . ':' . $minute . ':' . $second;
   
           return $postdate;
   
       }
       add_filter( 'umed_postdate', 'umed_postdate_from_filename', 10, 1 );
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Feature request’ is closed to new replies.

 * ![](https://ps.w.org/upload-media-exif-date/assets/icon-256x256.png?rev=2312702)
 * [Upload Media Exif Date](https://wordpress.org/plugins/upload-media-exif-date/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/upload-media-exif-date/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/upload-media-exif-date/)
 * [Active Topics](https://wordpress.org/support/plugin/upload-media-exif-date/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/upload-media-exif-date/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/upload-media-exif-date/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Katsushi Kawamori](https://wordpress.org/support/users/katsushi-kawamori/)
 * Last activity: [5 years, 2 months ago](https://wordpress.org/support/topic/feature-request-856/#post-14222576)
 * Status: not resolved