Same bug here.. And isn’t working for the post attachments too.
I debuged this issue and I found something, in mpd-functions.php method mpd_get_featured_image_from_source full URL is spected (https://mypage/wp-content/content…) but wp_get_attachment_image_src method return this kind of url /wp-content/content…
I modified this method to this and now it’s working on my site
/**
* Gets information on the featured image attached to a post
*
* This function will get the meta data and other information on the posts featured image; including the url
* to the full size version of the image.
*
* @since 0.5
* @param int $post_id The ID of the post that the featured image is attached to.
* @return array
*
* Example
*
* id => '23',
* url => 'https://www.example.com/image/image.jpg',
* alt => 'Image Alt Tag',
* description => 'Probably a big string of text here',
* caption => 'A nice caption for the image hopefully'
*
*/
function mpd_get_featured_image_from_source($post_id){
$thumbnail_id = get_post_thumbnail_id($post_id);
$image = wp_get_attachment_image_src($thumbnail_id, 'full');
if($image){
$image_details = array(
'url' => get_attached_file($thumbnail_id),
'alt' => get_post_meta( $thumbnail_id, '_wp_attachment_image_alt', true ),
'post_title' => get_post_field('post_title', $thumbnail_id),
'description' => get_post_field('post_content', $thumbnail_id),
'caption' => get_post_field('post_excerpt', $thumbnail_id),
'post_name' => get_post_field('post_name', $thumbnail_id)
);
$image_details = apply_filters( 'mpd_featured_image', $image_details );
return $image_details;
}
}
-
This reply was modified 8 years, 6 months ago by
joedev91.