WordPress.org

Make WordPress Core

Ticket #45366: 45366.diff

File 45366.diff, 690 bytes (added by greatislander, 3 years ago)

Patch from https://github.com/WordPress/WordPress/pull/386

  • wp-includes/post-template.php

    diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php
    index 8219b27f699..4f957428a5d 100644
    a b function wp_list_post_revisions( $post_id = 0, $type = 'all' ) { 
    18861886                _deprecated_argument( __FUNCTION__, '3.6.0' );
    18871887        }
    18881888
    1889         if ( ! $revisions = wp_get_post_revisions( $post->ID ) ) {
     1889        if ( ! $revisions = wp_get_post_revisions( $post->ID, array( 'fields' => 'ids' ) ) ) {
    18901890                return;
    18911891        }
    18921892
    18931893        $rows = '';
    18941894        foreach ( $revisions as $revision ) {
    1895                 if ( ! current_user_can( 'read_post', $revision->ID ) ) {
     1895                if ( ! current_user_can( 'read_post', $revision ) ) {
    18961896                        continue;
    18971897                }
    18981898