
Get detailed Exif information about the media file.
/** ================================================== * Sample snippet 1 * * The original filter hook('exif_details_data'), * which changes the display when retrieving an Exif and storing it in metadata. * The following changes the display of the shooting date and time. * * @param array $exifdatas exifdatas. * @param int $id id. */ function exif_details_change( $exifdatas, $id ) { if ( array_key_exists( 'DateTimeOriginal', $exifdatas ) ) { $shooting_date = str_replace( ':', '-', substr( $exifdatas['DateTimeOriginal'], 0, 10 ) ); $shooting_time = substr( $exifdatas['DateTimeOriginal'], 10 ); $exifdatas['DateTimeOriginal'] = $shooting_date . $shooting_time; } return $exifdatas; } add_filter( 'exif_details_data', 'exif_details_change', 10, 2 ); /** ================================================== * Sample snippet 2 * * Retrieve the post metadata and add the date and time of the shooting to the title of the media page. * Execute the original action hook('exif_details_update') in the function. * * @param array $title title. * @param int $id id. */ function media_title( $title, $id ) { $datetime = null; if ( is_attachment() ) { do_action( 'exif_details_update', $id ); $exifdatas = get_post_meta( $id, '_exif_details', true ); if ( ! empty( $exifdatas ) && array_key_exists( 'DateTimeOriginal', $exifdatas ) ) { $datetime = ' Date:' . $exifdatas['DateTimeOriginal']; } } return $title . $datetime; } add_filter( 'the_title', 'media_title', 10, 2 ); /** ================================================== * Sample snippet 3 * * When adding new media, insert the processed data into the caption. * Use the original action hook ('exif_details_update') with function. * * @param array $metadata metadata. * @param int $id id. */ function media_caption( $metadata, $id ) { $mime_type = get_post_mime_type( $id ); if ( in_array( $mime_type, array( 'image/jpeg', 'image/tiff' ) ) ) { do_action( 'exif_details_update', $id ); $exifdatas = get_post_meta( $id, '_exif_details', true ); if ( ! empty( $exifdatas ) ) { $camera = null; $f_number = null; $s_speed = null; $iso = null; $date = null; $googlemap = null; if ( array_key_exists( 'Model', $exifdatas ) ) { $camera = 'Camera:' . $exifdatas['Model']; } if ( array_key_exists( 'ApertureFNumber', $exifdatas ) ) { $f_number = 'F-number:' . $exifdatas['ApertureFNumber']; } if ( array_key_exists( 'ExposureTime', $exifdatas ) ) { $s_speed = 'Shutter speed:' . $exifdatas['ExposureTime']; } if ( array_key_exists( 'ISOSpeedRatings', $exifdatas ) ) { $isodata = json_decode( $exifdatas['ISOSpeedRatings'] ); if ( is_array( $isodata ) ) { $iso = 'ISO:' . $isodata[0]; } else { $iso = 'ISO:' . $isodata; } } if ( array_key_exists( 'DateTimeOriginal', $exifdatas ) ) { $date = 'Date:' . $exifdatas['DateTimeOriginal']; } if ( array_key_exists( 'latitude_dd', $exifdatas ) && array_key_exists( 'longtitude_dd', $exifdatas ) ) { $googlemap = '<a href="https://www.google.com/maps?q=' . $exifdatas['latitude_dd'] . ',' . $exifdatas['longtitude_dd'] . '">Google Map</a>'; } $caption = sprintf( '%1$s %2$s %3$s %4$s %5$s %6$s', $camera, $f_number, $s_speed, $iso, $date, $googlemap ); $caption = rtrim( $caption ); $caption = preg_replace( '/\s(?=\s)/', '', $caption ); $media_post = array( 'ID' => $id, 'post_excerpt' => $caption, ); wp_update_post( $media_post ); } } return $metadata; } add_filter( 'wp_generate_attachment_metadata', 'media_caption', 10, 2 ); Starting from $0 per month.
Rating
Reviewers
No reviews
Tags
Developed By
Katsushi Kawamori
Quick & Easy
Common Ninja has a large selection of powerful Wordpress plugins that are easy to use, fully customizable, mobile-friendly and rich with features — so be sure to check them out!
Testimonial plugins for Wordpress
Contact Form plugins for Wordpress
Maps plugins for Wordpress
Translation plugins for Wordpress
Chat plugins for Wordpress
Slider plugins for Wordpress
Reviews plugins for Wordpress
Contact plugins for Wordpress
Galleries plugins for Wordpress
SEO plugins for Wordpress
Forms plugins for Wordpress
Comments plugins for Wordpress
Backup plugins for Wordpress
Privacy plugins for Wordpress
Optimize plugins for Wordpress
Tabs plugins for Wordpress
Social Sharing plugins for Wordpress
Events Calendar plugins for Wordpress
Comments plugins for Wordpress
Social Feeds plugins for Wordpress
Social Sharing plugins for Wordpress
Portfolio plugins for Wordpress
Video Player plugins for Wordpress
popup plugins for Wordpress
SiteMap plugins for Wordpress
Payment plugins for Wordpress
Coming Soon plugins for Wordpress
Inventory plugins for Wordpress
Testimonials plugins for Wordpress
Portfolio plugins for Wordpress
Membership plugins for Wordpress
Forms plugins for Wordpress
Analytics plugins for Wordpress
Events Calendar plugins for Wordpress
Sliders plugins for Wordpress
Analytics plugins for Wordpress
Reviews plugins for Wordpress
Security plugins for Wordpress
Ads plugins for Wordpress
Music Player plugins for Wordpress
Countdown plugins for Wordpress
Email Marketing plugins for Wordpress
Membership plugins for Wordpress
Ecommerce plugins for Wordpress
Customer Support plugins for Wordpress
Video Player plugins for Wordpress
Tabs plugins for Wordpress
Social Feeds plugins for Wordpress
Common Ninja Apps
Browse our extensive collection of compatible plugins, and easily embed them on any website, blog, online store, e-commerce platform, or site builder.
Add a PDF viewer to your site to display documents, share product information, and give visitors easy access to helpful content in one place.
Show live streams and clips with a Twitch feed that keeps content fresh, boosts engagement, and helps visitors follow your channel more easily.
Add a no-code audio player to your site and boost engagement with music, podcasts, and voice content effortlessly.
Add opening hours to your site to give visitors clear, reliable business information that improves trust, reduces confusion, and supports user experience.
Add social share buttons so visitors share content to major networks, boost engagement, and drive more referral traffic.
Add a logo slider to your site to showcase clients and partners, strengthen brand credibility, and build trust with new visitors.
Display and manage customer reviews from multiple platforms in one place to build trust and highlight brand credibility.
Use a reviews badge to highlight your ratings, build trust at a glance, improve credibility, and help increase conversions across your site.

Show YouTube videos in a customizable YouTube feed that keeps content fresh, boosts watch time, and helps visitors explore more of your channel.

Use an engagement toolbox that combines forms, galleries, chats, and interactive elements to increase visitor activity and create a more engaging user experience.
Detect ad blockers on your site to maintain visibility into user behavior and support sustainable ad-based monetization.
Show rankings and performance data on your site with a customizable scores board that motivates participation and keeps users engaged.
More plugins
The Common Ninja Search Engine platform helps website builders find the best site widgets, apps, plugins, tools, add-ons, and extensions! Compatible with all major website building platforms - big or small - and updated regularly, our Search Engine tool provides you with the business tools your site needs!
