mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-04 01:00:04 +00:00
Post Thumbnails: Prevent post thumbnail previews from spilling into other images.
After [38118], when previewing a page with a secondary loop, all post thumbnails would be filtered to display the post thumbnail for the page being previewed. This ensures `_wp_preview_post_thumbnail_filter()` is only applied if the `$post_id` of the post meta being filtered is equal to the post or page being previewed. Props swisspidy, joemcgill. Fixes #37697. git-svn-id: https://develop.svn.wordpress.org/trunk@38433 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -594,7 +594,13 @@ function _wp_preview_post_thumbnail_filter( $value, $post_id, $meta_key ) {
|
||||
return $value;
|
||||
}
|
||||
|
||||
if ( empty( $_REQUEST['_thumbnail_id'] ) || $post->ID != $post_id || '_thumbnail_id' != $meta_key || 'revision' == $post->post_type ) {
|
||||
if ( empty( $_REQUEST['_thumbnail_id'] ) ||
|
||||
empty( $_REQUEST['preview_id'] ) ||
|
||||
$post->ID != $post_id ||
|
||||
'_thumbnail_id' != $meta_key ||
|
||||
'revision' == $post->post_type ||
|
||||
$post_id != $_REQUEST['preview_id']
|
||||
) {
|
||||
return $value;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user