Make WordPress Core


Ignore:
Timestamp:
07/10/2020 03:12:00 PM (4 years ago)
Author:
adamsilverstein
Message:

Revisions: optimize performance when post has large number of revisions.

Improve speed and reduce the memory footprint when loading posts with many revisions.

  • Use a direct query in wp_get_post_autosave to avoid loading all revisions.
  • Query for IDs vs full objects in register_and_do_post_meta_boxes.

Props pdfernhout, johnnyb, miqrogroove, ocean90, senatorman, DBrumbaugh10Up, martijn-van-der-kooij, pavelevap, mackensen, mikeyarce, whyisjake.
Fixes #34560.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/customize/manager.php

    r47663 r48422  
    18921892        // Verify that autosave happened.
    18931893        $autosave_revision = wp_get_post_autosave( $changeset_post_id, get_current_user_id() );
    1894         $this->assertInstanceOf( 'WP_Post', $autosave_revision );
     1894        $this->assertInstanceOf( 'stdClass', $autosave_revision );
    18951895        $this->assertContains( 'Draft Title', get_post( $changeset_post_id )->post_content );
    18961896        $this->assertContains( 'Autosave Title', $autosave_revision->post_content );
Note: See TracChangeset for help on using the changeset viewer.