Changeset 23830
- Timestamp:
- 03/28/2013 12:56:44 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post-template.php
r23819 r23830 1417 1417 extract( wp_parse_args( $args, $defaults ), EXTR_SKIP ); 1418 1418 1419 switch ( $type ) { 1420 case 'autosave' : 1421 if ( !$autosave = wp_get_post_autosave( $post->ID ) ) 1422 return; 1423 $revisions = array( $autosave ); 1424 break; 1425 case 'revision' : // just revisions - remove autosave later 1426 case 'all' : 1427 default : 1428 if ( !$revisions = wp_get_post_revisions( $post->ID ) ) 1429 return; 1430 break; 1431 } 1419 if ( !$revisions = wp_get_post_revisions( $post->ID ) ) 1420 return; 1432 1421 1433 1422 /* translators: post revision: 1: when, 2: author name */ 1434 1423 $titlef = _x( '%1$s', 'post revision' ); 1435 1424 1436 if ( $parent ) 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_first_revision_matches_current_version( $post_id ); 1428 if ( $parent_included && ! $parent ) 1429 array_pop( $revisions ); 1430 elseif ( ! $parent_included && $parent ) 1437 1431 array_unshift( $revisions, $post ); 1438 1439 // since 3.6 revisions include a copy of the current post data as a revision1440 // the collowing removes this current revision if present from the list of1441 // revisions returned by wp_list_post_revisions, remove these to include the1442 // crrent post revision in the list of revisions1443 if ( wp_first_revision_matches_current_version( $post_id ) )1444 array_pop( $revisions );1445 1432 1446 1433 $rows = $right_checked = ''; … … 1450 1437 if ( !current_user_can( 'read_post', $revision->ID ) ) 1451 1438 continue; 1452 if ( 'revision' === $type && wp_is_post_autosave( $revision ) ) 1439 1440 $is_autosave = wp_is_post_autosave( $revision ); 1441 if ( ( 'revision' === $type && $is_autosave ) || ( 'autosave' === $type && ! $is_autosave ) ) 1453 1442 continue; 1454 1443 … … 1530 1519 1531 1520 endif; 1532 1533 } 1521 }
Note: See TracChangeset
for help on using the changeset viewer.