X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/607b7e02d77e7326161e8ec15639052d2040f745..16e7b37c7914d753890c1a05a9335f3b43751eb8:/wp-includes/revision.php diff --git a/wp-includes/revision.php b/wp-includes/revision.php index b5886219..c166fbf1 100644 --- a/wp-includes/revision.php +++ b/wp-includes/revision.php @@ -321,9 +321,10 @@ function _wp_put_post_revision( $post = null, $autosave = false ) { * @since 2.6.0 * * @param int|WP_Post $post The post ID or object. - * @param string $output Optional. OBJECT, ARRAY_A, or ARRAY_N. + * @param string $output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which correspond to + * a WP_Post object, an associative array, or a numeric array, respectively. Default OBJECT. * @param string $filter Optional sanitation filter. See sanitize_post(). - * @return WP_Post|array|null Null if error or post object if success. + * @return WP_Post|array|null WP_Post (or array) on success, or null on failure. */ function wp_get_post_revision(&$post, $output = OBJECT, $filter = 'raw') { if ( !$revision = get_post( $post, OBJECT, $filter ) ) @@ -594,7 +595,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; }