Fix for bug in wp_get_attachment_thumb_file
-
wp_get_attachment_thumb_file would not return the file path. I patched wp-includes/post.php function wp_get_attachment_thumb_file and now it seems to be working.
Existing code in function:
if ( !empty($imagedata['thumb']) && ($thumbfile = str_replace(basename($file), $imagedata['thumb'], $file)) && file_exists($thumbfile) )return apply_filters( 'wp_get_attachment_thumb_file', $thumbfile, $post->ID );
New code in function:
if ( !empty($imagedata['sizes']['thumbnail']['file']) && ($thumbfile = str_replace(basename($file), $imagedata['sizes']['thumbnail']['file'], $file)) && file_exists($thumbfile) )return apply_filters( 'wp_get_attachment_thumb_file', $thumbfile, $post->ID );
- The topic ‘Fix for bug in wp_get_attachment_thumb_file’ is closed to new replies.