0

wp_get_attachment_metadata( get_post_thumbnail_id( get_the_ID() ) )['image_meta']['credit'] returns nothing although there IS information in the attachment's credit field.

Is wp_get_attachment_metadata for that EXIF data stuff or is it for the fields in the media manager?

Am I stupid?

0

It is for EXIF data.

But if that's the code you're using, it looks like you are trying to access array elements on a function call.

Try

$my_data = wp_get_attachment_metadata( get_post_thumbnail_id( get_the_ID() ) );

echo $my_data['image_meta']['credit'];

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.