Make WordPress Core

Changeset 23975


Ignore:
Timestamp:
04/12/2013 07:29:21 PM (12 years ago)
Author:
azaozz
Message:

Revisions: compare revisions by date in wp_ajax_revisions_data(), deprecate the $parent arg in wp_list_post_revisions() as now revisions always include a copy of the current post, props adamsilverstein, see #23901

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/ajax-actions.php

    r23907 r23975  
    21302130
    21312131        // make sure the right revision is the most recent
    2132         if ( $compare_two_mode && $right_revision->ID < $left_revision->ID ) {
     2132        if ( $compare_two_mode && $right_revision->post_date < $left_revision->post_date ) {
    21332133            $temp = $left_revision;
    21342134            $left_revision = $right_revision;
  • trunk/wp-includes/post-template.php

    r23885 r23975  
    13881388 * Second argument controls parameters:
    13891389 *   (bool)   parent : include the parent (the "Current Revision") in the list.
     1390 *                     Deprecated (ignored), since 3.6 the revisions always include
     1391 *                     a copy of the current post.
    13901392 *   (string) format : 'list' or 'form-table'. 'list' outputs UL, 'form-table'
    13911393 *                     outputs TABLE with UI.
     
    14141416        return;
    14151417
    1416     $defaults = array( 'parent' => false, 'right' => false, 'left' => false, 'format' => 'list', 'type' => 'all' );
     1418    $defaults = array( 'right' => false, 'left' => false, 'format' => 'list', 'type' => 'all' );
    14171419    extract( wp_parse_args( $args, $defaults ), EXTR_SKIP );
    14181420
     
    14221424    /* translators: post revision: 1: when, 2: author name */
    14231425    $titlef = _x( '%1$s', 'post revision' );
    1424 
    1425     // Since 3.6 revisions include a copy of the current post data as a revision.
    1426     // The following removes that revision when $parent == false
    1427     $parent_included = _wp_get_post_revision_version( reset( $revisions ) ) > 0;
    1428     if ( $parent_included && ! $parent )
    1429         array_shift( $revisions );
    1430     elseif ( ! $parent_included && $parent )
    1431         array_unshift( $revisions, $post );
    14321426
    14331427    $rows = $right_checked = '';
Note: See TracChangeset for help on using the changeset viewer.