Changeset 8011 for trunk/wp-includes/post-template.php
- Timestamp:
- 05/29/2008 10:21:36 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post-template.php
r7913 r8011 594 594 $date = "<a href='$link'>$date</a>"; 595 595 596 if ( 'revision' != $revision->post_type)596 if ( !wp_is_post_revision( $revision ) ) 597 597 $date = sprintf( $currentf, $date ); 598 elseif ( "{$revision->post_parent}-autosave" == $revision->post_name)598 elseif ( wp_is_post_autosave( $revision ) ) 599 599 $date = sprintf( $autosavef, $date ); 600 600 … … 629 629 return; 630 630 631 if ( !$revisions = wp_get_post_revisions( $post->ID ) ) 632 return; 633 634 $defaults = array( 'parent' => false, 'right' => false, 'left' => false, 'format' => 'list' ); 631 $defaults = array( 'parent' => false, 'right' => false, 'left' => false, 'format' => 'list', 'type' => 'all' ); 635 632 extract( wp_parse_args( $args, $defaults ), EXTR_SKIP ); 633 634 switch ( $type ) { 635 case 'autosave' : 636 if ( !$autosave = wp_get_post_autosave( $post->ID ) ) 637 return; 638 $revisions = array( $autosave ); 639 break; 640 case 'revision' : // just revisions - remove autosave later 641 case 'all' : 642 default : 643 if ( !$revisions = wp_get_post_revisions( $post->ID ) ) 644 return; 645 break; 646 } 636 647 637 648 $titlef = _c( '%1$s by %2$s|post revision 1:datetime, 2:name' ); … … 645 656 foreach ( $revisions as $revision ) { 646 657 if ( !current_user_can( 'read_post', $revision->ID ) ) 658 continue; 659 if ( 'revision' === $type && wp_is_post_autosave( $revision ) ) 647 660 continue; 648 661
Note: See TracChangeset
for help on using the changeset viewer.