Coding Standards: Use strict comparison in wp-includes/revision.php.

Follow-up to [24414], [38118], [38433].

Props aristath, poena, afercia, SergeyBiryukov.
See #58831.
Built from https://develop.svn.wordpress.org/trunk@56359


git-svn-id: http://core.svn.wordpress.org/trunk@55871 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2023-08-04 11:58:25 +00:00
parent b26df97c16
commit ba7c01a09c
2 changed files with 7 additions and 9 deletions

View File

@ -768,7 +768,7 @@ function _wp_preview_terms_filter( $terms, $post_id, $taxonomy ) {
return $terms;
}
if ( empty( $_REQUEST['post_format'] ) || $post->ID != $post_id
if ( empty( $_REQUEST['post_format'] ) || $post->ID !== $post_id
|| 'post_format' !== $taxonomy || 'revision' === $post->post_type
) {
return $terms;
@ -778,6 +778,7 @@ function _wp_preview_terms_filter( $terms, $post_id, $taxonomy ) {
$terms = array();
} else {
$term = get_term_by( 'slug', 'post-format-' . sanitize_key( $_REQUEST['post_format'] ), 'post_format' );
if ( $term ) {
$terms = array( $term ); // Can only have one post format.
}
@ -804,13 +805,10 @@ function _wp_preview_post_thumbnail_filter( $value, $post_id, $meta_key ) {
return $value;
}
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'] ) {
if ( empty( $_REQUEST['_thumbnail_id'] ) || empty( $_REQUEST['preview_id'] )
|| $post->ID !== $post_id || $post_id !== (int) $_REQUEST['preview_id']
|| '_thumbnail_id' !== $meta_key || 'revision' === $post->post_type
) {
return $value;
}

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.4-alpha-56358';
$wp_version = '6.4-alpha-56359';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.