$imgID doesn't work with filters & shortcode
-
Your filters are brilliant and I have successfully tooled and tweaked my output the way I want it. I’m actually using the shortcode to display the exif by simply placing it in the image caption.
All works well when displaying the exif info the image attachment pages, but not when displaying within a post. Some data I gather using wp_get_attachment_metadata($imgID). This data is what is missing on posts but displays fine on the attachment pages.
What am I missing?
function clean_exif($content,$postID,$imgID){ unset($content['caption']); unset($content['title']); unset($content['created_timestamp']);]); $imgmeta = wp_get_attachment_metadata($imgID); $width= $imgmeta['image_meta']['width']; $height = $imgmeta['image_meta']['height']; array_push($content,$height . 'x' . $width); return $content; add_filter('exifography_display_exif','clean_exif');
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘$imgID doesn't work with filters & shortcode’ is closed to new replies.