Created
October 5, 2023 18:55
-
-
Save sunshinephotocart/aa1b28c54fdc2dc1ed9fb9bb8cd9b3f6 to your computer and use it in GitHub Desktop.
Show keywords for an image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'sunshine_after_image', 'sunshine_show_image_keywords' ); | |
function sunshine_show_image_keywords( $image ) { | |
$metadata = $image->get_meta_value( '_wp_attachment_metadata' ); | |
if ( ! empty( $metadata['image_meta']['keywords'] ) ) { | |
echo join( ', ', $metadata['image_meta']['keywords'] ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment