Make WordPress Core

Ticket #37697: 37697.diff

File 37697.diff, 1.2 KB (added by joemcgill, 8 years ago)
  • src/wp-includes/revision.php

    diff --git src/wp-includes/revision.php src/wp-includes/revision.php
    index b588621..b8fd21f 100644
    function _wp_preview_post_thumbnail_filter( $value, $post_id, $meta_key ) { 
    594594                return $value;
    595595        }
    596596
    597         if ( empty( $_REQUEST['_thumbnail_id'] ) || $post->ID != $post_id || '_thumbnail_id' != $meta_key || 'revision' == $post->post_type ) {
     597        if ( empty( $_REQUEST['_thumbnail_id'] ) || $post->ID != $post_id || '_thumbnail_id' != $meta_key || 'revision' == $post->post_type || $post_id != $_REQUEST['preview_id'] ) {
    598598                return $value;
    599599        }
    600600
  • tests/phpunit/tests/post/thumbnails.php

    diff --git tests/phpunit/tests/post/thumbnails.php tests/phpunit/tests/post/thumbnails.php
    index 827a339..53bf1c3 100644
    class Tests_Post_Thumbnail_Template extends WP_UnitTestCase { 
    242242
    243243                $GLOBALS['post'] = self::$post;
    244244                $_REQUEST['_thumbnail_id'] = self::$attachment_id;
     245                $_REQUEST['preview_id'] = self::$post->ID;
    245246
    246247                $result = _wp_preview_post_thumbnail_filter( '', self::$post->ID, '_thumbnail_id' );
    247248                $this->assertEquals( self::$attachment_id, $result );