Does not show image by url
-
Hi in thumbnail.php around line 100 in fifu_replace() which is a filter for post_thumbnail_html we have:
if ($url) { if (fifu_is_on('fifu_class')) { if (strpos($html, 'class=')) $html = preg_replace('/class=[\'\"][^[\'\"]*[\'\"]/', 'class="fifu-class"', $html); else $html = str_replace('<img', '<img class="fifu-class"', $html); } return $css ? str_replace('/>', ' style="' . $css . '"/>', $html) : $html; } return !$url ? $html : fifu_get_html($url, $alt, $width, $height); }
I added some logging.
If there is a $url (it exists in my case) it returns prematurely in the line ‘return $css ?….’ without having the chance to add the image.This is done in the last line but it never gets there if $url exists.
I think a proper patch is:
--- wp-content/plugins/featured-image-from-url/includes/thumbnail.php (revision 21128) +++ wp-content/plugins/featured-image-from-url/includes/thumbnail.php (working copy) @@ -112,7 +112,7 @@ $html = str_replace('<img', '<img class="fifu-class"', $html); } - return $css ? str_replace('/>', ' style="' . $css . '"/>', $html) : $html; + $html = $css ? str_replace('/>', ' style="' . $css . '"/>', $html) : $html; } return !$url ? $html : fifu_get_html($url, $alt, $width, $height);
- The topic ‘Does not show image by url’ is closed to new replies.