diff --git a/wp-admin/includes/meta-boxes.php b/wp-admin/includes/meta-boxes.php index 18fc9eb23a..3cb74418cb 100644 --- a/wp-admin/includes/meta-boxes.php +++ b/wp-admin/includes/meta-boxes.php @@ -602,8 +602,8 @@ function post_author_meta_box($post) { * * @param object $post */ -function post_revisions_meta_box($post) { - wp_list_post_revisions(); +function post_revisions_meta_box( $post ) { + wp_list_post_revisions( $post ); } // -- Page related Meta Boxes @@ -979,4 +979,4 @@ function link_advanced_meta_box($link) { function post_thumbnail_meta_box( $post ) { $thumbnail_id = get_post_meta( $post->ID, '_thumbnail_id', true ); echo _wp_post_thumbnail_html( $thumbnail_id, $post->ID ); -} \ No newline at end of file +} diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index 34016952bb..2e5731c32e 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -1384,17 +1384,6 @@ function wp_post_revision_title_expanded( $revision, $link = true ) { * Can output either a UL with edit links or a TABLE with diff interface, and * restore action links. * - * Second argument controls parameters: - * (bool) parent : include the parent (the "Current Revision") in the list. - * Deprecated (ignored), since 3.6 the revisions always include - * a copy of the current post. - * (string) format : 'list' or 'form-table'. 'list' outputs UL, 'form-table' - * outputs TABLE with UI. - * (int) right : what revision is currently being viewed - used in - * form-table format. - * (int) left : what revision is currently being diffed against right - - * used in form-table format. - * * @package WordPress * @subpackage Post_Revisions * @since 2.6.0 @@ -1404,25 +1393,26 @@ function wp_post_revision_title_expanded( $revision, $link = true ) { * @uses get_edit_post_link() * @uses get_the_author_meta() * - * @todo split into two functions (list, form-table) ? - * * @param int|object $post_id Post ID or post object. - * @param string|array $args See description {@link wp_parse_args()}. + * @param string $type 'all' (default), 'revision' or 'autosave' * @return null */ -function wp_list_post_revisions( $post_id = 0, $args = null ) { - if ( !$post = get_post( $post_id ) ) +function wp_list_post_revisions( $post_id = 0, $type = 'all' ) { + if ( ! $post = get_post( $post_id ) ) return; - $defaults = array( 'right' => false, 'left' => false, 'format' => 'list', 'type' => 'all' ); - extract( wp_parse_args( $args, $defaults ), EXTR_SKIP ); + // $args array with (parent, format, right, left, type) deprecated since 3.6 + if ( is_array( $type ) ) { + $type = ! empty( $type['type'] ) ? $type['type'] : $type; + _deprecated_argument( __FUNCTION__, '3.6' ); + } - if ( !$revisions = wp_get_post_revisions( $post->ID ) ) + if ( ! $revisions = wp_get_post_revisions( $post->ID ) ) return; $rows = ''; foreach ( $revisions as $revision ) { - if ( !current_user_can( 'read_post', $revision->ID ) ) + if ( ! current_user_can( 'read_post', $revision->ID ) ) continue; $is_autosave = wp_is_post_autosave( $revision ); @@ -1432,74 +1422,33 @@ function wp_list_post_revisions( $post_id = 0, $args = null ) { $rows .= "\t
  • " . wp_post_revision_title_expanded( $revision ) . "
  • \n"; } - if ( 'form-table' == $format ) : ?> + echo "