[wp-trac] [WordPress Trac] #49751: Old Featured Images (Thumbnails) Broken in 5.4
WordPress Trac
noreply at wordpress.org
Wed Apr 1 12:30:49 UTC 2020
#49751: Old Featured Images (Thumbnails) Broken in 5.4
-----------------------------+-----------------------------
Reporter: ispreview | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Post Thumbnails | Version: 5.4
Severity: major | Keywords:
Focuses: |
-----------------------------+-----------------------------
This is a follow-up to #40096.
The change introduced above has caused older Featured Article Images to
appear blank (the HTML IMG code doesn't even render into the page -
there's no code at all), such as any posted from a gallery in the 'NextGen
Gallery' plugin before at least v2 (including the NextCellent Gallery fork
that was also based off the older v1.9 series of NextGen). All of these
share the same broad database structure, which has allowed people to
upgrade over the years.
None of this seems to affect featured images posted more recently from a
gallery under the modern NextGen Gallery plugin, but people may only
realise later if their older featured images no longer display on articles
(they'd need to check their archives). Simply using the latest version of
NextGen does not solve this as the WP code change is the one that directly
breaks the older featured images.
For example:
OLD Featured Image Code that no longer exists after WP5.4 (it's just blank
/ gone):
{{{
<img src="https://.../wp-content/gallery/2019-nextgen/thumbs/EXAMPLE.jpg"
alt="EXAMPLE" title="2019-nextgen" class="wp-post-image ngg-image-792 ">
}}}
NEW Featured Image Code that still exists and works under WP5.4:
{{{
<img src="https://.../wp-content/uploads/EXAMPLE2.jpg" class="attachment-
thumbnail size-thumbnail wp-post-image" alt="" width="600" height="600">
}}}
I can "fix" this by changing the #40096 code in wp-includes/post-
thumbnail-template.php back to what it was in WP5.3, which means replacing
the WP5.4 line with this 5.3 line but that is obviously far from ideal:
{{{
return get_post_meta( $post->ID, '_thumbnail_id', true );
}}}
I am posting this here because neither the NextCellent nor older NextGen
Gallery code/plugins are supported anymore, but the issue is that many
sites will have historically posted several years worth of affected posts
with now blank featured images that they can't resolve (ours run between
2012 and 2019 - impacting tens of thousands of articles).
Many other sites will be affected by this and probably just haven't
noticed yet. I only spotted it because we moved to NextGen Gallery from
NextCellent Gallery last year. I'm not sure what the WordPress team can do
here but it does need to be highlighted as others will come across this
with time.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/49751>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list