Skip to content

Commit 9f3b26c

Browse files
Merge pull request #1207 from Codeinwp/bugfix/pro/957
Added fallback for media thumbnail retrieval
2 parents 54b7828 + cc1b8d5 commit 9f3b26c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

includes/abstract/feedzy-rss-feeds-admin-abstract.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1767,6 +1767,15 @@ public function feedzy_retrieve_image( $item, $sc = null ) {
17671767
$the_thumbnail = $data['0']['attribs']['']['href'];
17681768
}
17691769
}
1770+
// xmlns:media thumbnail.
1771+
if ( empty( $the_thumbnail ) ) {
1772+
$data = $item->get_item_tags( 'http://search.yahoo.com/mrss/', 'thumbnail' );
1773+
if ( isset( $data['0']['attribs']['']['url'] ) && ! empty( $data['0']['attribs']['']['url'] ) ) {
1774+
$the_thumbnail = $data['0']['attribs']['']['url'];
1775+
} elseif ( isset( $data['0']['data'] ) && ! empty( $data['0']['data'] ) ) {
1776+
$the_thumbnail = $data['0']['data'];
1777+
}
1778+
}
17701779
// Content image.
17711780
if ( empty( $the_thumbnail ) ) {
17721781
$feed_description = $item->get_content();

0 commit comments

Comments
 (0)