diff --git a/wp-includes/revision.php b/wp-includes/revision.php index e8bbcdbce4..d5a5829d7e 100644 --- a/wp-includes/revision.php +++ b/wp-includes/revision.php @@ -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; } diff --git a/wp-includes/version.php b/wp-includes/version.php index efd4a31a43..40cb179f64 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.