Skip to content

Commit efd5a26

Browse files
committed
incorporating pull request fix error in mpd_get_image_alt_tags magicstickuk#54
1 parent 7e2affb commit efd5a26

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

inc/mpd-functions.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,13 @@ function mpd_get_image_alt_tags($post_media_attachments){
638638

639639
foreach ($post_media_attachments as $post_media_attachment) {
640640

641+
642+
//pull request fix error in mpd_get_image_alt_tags #54
643+
if ( array_key_exists( "object", $post_media_attachment ) ) {
644+
$post_id = $post_media_attachment[ "object" ]->ID;
645+
} else {
646+
$post_id = $post_media_attachment->ID;
647+
}
641648
$alt_tag = get_post_meta($post_media_attachment->ID, '_wp_attachment_image_alt', true);
642649

643650
$alt_tags_to_be_copied[$attachement_count] = $alt_tag;

0 commit comments

Comments
 (0)