X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/baca9ce86a38dc54c4574890ee2d352fd81f78b2..61343b82c4f0da4c68e4c6373daafff4a81efdd1:/wp-admin/includes/class-wp-posts-list-table.php diff --git a/wp-admin/includes/class-wp-posts-list-table.php b/wp-admin/includes/class-wp-posts-list-table.php index c772fa63..a798a2c2 100644 --- a/wp-admin/includes/class-wp-posts-list-table.php +++ b/wp-admin/includes/class-wp-posts-list-table.php @@ -382,8 +382,10 @@ class WP_Posts_List_Table extends WP_List_Table { if ( $count >= $end ) break; - if ( $count >= $start ) - echo "\t" . $this->single_row( $page, $level ); + if ( $count >= $start ) { + echo "\t"; + $this->single_row( $page, $level ); + } $count++; @@ -397,8 +399,12 @@ class WP_Posts_List_Table extends WP_List_Table { foreach ( $orphans as $op ) { if ( $count >= $end ) break; - if ( $count >= $start ) - echo "\t" . $this->single_row( $op, 0 ); + + if ( $count >= $start ) { + echo "\t"; + $this->single_row( $op, 0 ); + } + $count++; } } @@ -444,13 +450,16 @@ class WP_Posts_List_Table extends WP_List_Table { } $num_parents = count( $my_parents ); while ( $my_parent = array_pop( $my_parents ) ) { - echo "\t" . $this->single_row( $my_parent, $level - $num_parents ); + echo "\t"; + $this->single_row( $my_parent, $level - $num_parents ); $num_parents--; } } - if ( $count >= $start ) - echo "\t" . $this->single_row( $page, $level ); + if ( $count >= $start ) { + echo "\t"; + $this->single_row( $page, $level ); + } $count++; @@ -471,10 +480,16 @@ class WP_Posts_List_Table extends WP_List_Table { $edit_link = get_edit_post_link( $post->ID ); $title = _draft_or_post_title(); $post_type_object = get_post_type_object( $post->post_type ); - $can_edit_post = current_user_can( $post_type_object->cap->edit_post, $post->ID ); + $can_edit_post = current_user_can( 'edit_post', $post->ID ); $alternate = 'alternate' == $alternate ? '' : 'alternate'; $classes = $alternate . ' iedit author-' . ( get_current_user_id() == $post->post_author ? 'self' : 'other' ); + + $lock_holder = wp_check_post_lock( $post->ID ); + if ( $lock_holder ) { + $classes .= ' wp-locked'; + $lock_holder = get_userdata( $lock_holder ); + } ?> - + - +
+ hierarchical_display ) { - $attributes = 'class="post-title page-title column-title"' . $style; - if ( 0 == $level && (int) $post->post_parent > 0 ) { //sent level 0 by accident, by default, or because we don't know the actual level $find_main_page = (int) $post->post_parent; @@ -523,29 +543,49 @@ class WP_Posts_List_Table extends WP_List_Table { $parent_name = apply_filters( 'the_title', $parent->post_title, $parent->ID ); } } + } - $pad = str_repeat( '— ', $level ); -?> - >post_status != 'trash' ) { ?>labels->parent_item_colon . ' ' . esc_html( $parent_name ) : ''; ?> -"; + + if ( $format = get_post_format( $post->ID ) ) { + $label = get_post_format_string( $format ); + + echo '' . $label . ": "; } - else { - $attributes = 'class="post-title page-title column-title"' . $style; - $pad = str_repeat( '— ', $level ); -?> - >post_status != 'trash' ) { ?> -ID ) ) - the_excerpt(); + if ( $can_edit_post && $post->post_status != 'trash' ) { + echo '' . $pad . $title . ''; + } else { + echo $pad . $title; + } + _post_states( $post ); + + if ( isset( $parent_name ) ) + echo ' | ' . $post_type_object->labels->parent_item_colon . ' ' . esc_html( $parent_name ); + + echo "\n"; + + if ( $can_edit_post && $post->post_status != 'trash' ) { + if ( $lock_holder ) { + $locked_avatar = get_avatar( $lock_holder->ID, 18 ); + $locked_text = esc_html( sprintf( __( '%s is currently editing' ), $lock_holder->display_name ) ); + } else { + $locked_avatar = $locked_text = ''; + } + + echo '
' . $locked_avatar . ' ' . $locked_text . "
\n"; } + if ( ! $this->hierarchical_display && 'excerpt' == $mode && current_user_can( 'read_post', $post->ID ) ) + the_excerpt(); + $actions = array(); if ( $can_edit_post && 'trash' != $post->post_status ) { $actions['edit'] = '' . __( 'Edit' ) . ''; $actions['inline hide-if-no-js'] = '' . __( 'Quick Edit' ) . ''; } - if ( current_user_can( $post_type_object->cap->delete_post, $post->ID ) ) { + if ( current_user_can( 'delete_post', $post->ID ) ) { if ( 'trash' == $post->post_status ) $actions['untrash'] = "ID ) ), 'untrash-post_' . $post->ID ) . "'>" . __( 'Restore' ) . ""; elseif ( EMPTY_TRASH_DAYS ) @@ -556,7 +596,7 @@ class WP_Posts_List_Table extends WP_List_Table { if ( $post_type_object->public ) { if ( in_array( $post->post_status, array( 'pending', 'draft', 'future' ) ) ) { if ( $can_edit_post ) - $actions['view'] = '' . __( 'Preview' ) . ''; + $actions['view'] = '' . __( 'Preview' ) . ''; } elseif ( 'trash' != $post->post_status ) { $actions['view'] = '' . __( 'View' ) . ''; } @@ -820,10 +860,7 @@ class WP_Posts_List_Table extends WP_List_Table { - labels->name ) ?> - - - + labels->name ) ?>