Make WordPress Core


Ignore:
Timestamp:
07/11/2020 09:13:56 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Revisions: Restore the return value of wp_get_post_autosave() to the documented type of WP_Post for backward compatibility.

Follow-up to [48422].

See #34560.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/ajax/CustomizeManager.php

    r48422 r48438  
    473473        $this->assertEquals( 'draft', $this->_last_response_parsed['data']['changeset_status'] );
    474474        $autosave_revision = wp_get_post_autosave( $post_id );
    475         $this->assertInstanceOf( 'stdClass', $autosave_revision );
     475        $this->assertInstanceOf( 'WP_Post', $autosave_revision );
    476476
    477477        $this->assertContains( 'New Site Title', get_post( $post_id )->post_content );
     
    700700        $this->assertNotWPError( $r );
    701701        $autosave_revision = wp_get_post_autosave( $wp_customize->changeset_post_id() );
    702         $this->assertInstanceOf( 'stdClass', $autosave_revision );
     702        $this->assertInstanceOf( 'WP_Post', $autosave_revision );
    703703        $this->assertContains( 'Foo', get_post( $wp_customize->changeset_post_id() )->post_content );
    704704        $this->assertContains( 'Bar', $autosave_revision->post_content );
Note: See TracChangeset for help on using the changeset viewer.