Changeset 23372
- Timestamp:
- 02/02/2013 01:54:06 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/class-wp-posts-list-table.php
r23371 r23372 473 473 $post_type_object = get_post_type_object( $post->post_type ); 474 474 $can_edit_post = current_user_can( $post_type_object->cap->edit_post, $post->ID ); 475 $lock_holder_id = wp_check_post_lock( $post->ID );476 $lock_holder = '';477 475 478 476 $alternate = 'alternate' == $alternate ? '' : 'alternate'; 479 477 $classes = $alternate . ' iedit author-' . ( get_current_user_id() == $post->post_author ? 'self' : 'other' ); 480 481 if ( $lock_holder_id ) { 478 479 $lock_holder = wp_check_post_lock( $post->ID ); 480 if ( $lock_holder ) { 482 481 $classes .= ' wp-locked'; 483 $lock_holder_data = get_user_by( 'id', $lock_holder_id ); 484 485 if ( $lock_holder_data ) 486 $lock_holder = esc_html( sprintf( __('Currently edited by %s'), $lock_holder_data->data->display_name ) ); 482 $lock_holder = get_userdata( $lock_holder ); 487 483 } 488 484 ?> … … 521 517 522 518 case 'title': 519 $attributes = 'class="post-title page-title column-title"' . $style; 523 520 if ( $this->hierarchical_display ) { 524 $attributes = 'class="post-title page-title column-title"' . $style;525 526 521 if ( 0 == $level && (int) $post->post_parent > 0 ) { 527 522 //sent level 0 by accident, by default, or because we don't know the actual level … … 540 535 } 541 536 } 542 543 $pad = str_repeat( '— ', $level ); 544 545 ?> 546 <td <?php echo $attributes ?>><strong><?php if ( $can_edit_post && $post->post_status != 'trash' ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo esc_attr( sprintf( __( 'Edit “%s”' ), $title ) ); ?>"><?php echo $pad; echo $title ?></a><?php } else { echo $pad; echo $title; }; _post_states( $post ); echo isset( $parent_name ) ? ' | ' . $post_type_object->labels->parent_item_colon . ' ' . esc_html( $parent_name ) : ''; ?></strong> 547 <?php 548 549 if ( $can_edit_post && $post->post_status != 'trash' ) { 550 ?> 551 <span class="lock-holder"><?php echo $lock_holder; ?></span> 552 <?php 553 } 537 } 538 539 $pad = str_repeat( '— ', $level ); 540 echo "<td $attributes><strong>"; 541 if ( $can_edit_post && $post->post_status != 'trash' ) { 542 echo '<a class="row-title" href="' . $edit_link . '" title="' . esc_attr( sprintf( __( 'Edit “%s”' ), $title ) ) . '">' . $pad . $title . '</a>'; 554 543 } else { 555 $attributes = 'class="post-title page-title column-title"' . $style;556 557 $pad = str_repeat( '— ', $level);558 559 ?>560 <td <?php echo $attributes ?>><strong><?php if ( $can_edit_post && $post->post_status != 'trash' ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo esc_attr( sprintf( __( 'Edit “%s”' ), $title ) ); ?>"><?php echo $pad; echo $title ?></a><?php } else { echo $pad; echo $title; }; _post_states( $post ); ?></strong>561 <?php 562 563 if ( $can_edit_post && $post->post_status != 'trash' ) { 564 ?>565 <span class="lock-holder"><?php echo $lock_holder; ?></span>566 <?php567 568 569 if ('excerpt' == $mode && current_user_can( 'read_post', $post->ID ) )544 echo $pad . $title; 545 } 546 _post_states( $post ); 547 548 if ( isset( $parent_name ) ) 549 echo ' | ' . $post_type_object->labels->parent_item_colon . ' ' . esc_html( $parent_name ); 550 551 echo "</strong>\n"; 552 553 if ( $lock_holder && $can_edit_post && $post->post_status != 'trash' ) { 554 printf( '<span class="lock-holder">%s</span>', 555 esc_html( sprintf( __( '%s is currently editing' ), $lock_holder->display_name ) ) ); 556 } 557 558 if ( ! $this->hierarchical_display && 'excerpt' == $mode && current_user_can( 'read_post', $post->ID ) ) 570 559 the_excerpt(); 571 }572 560 573 561 $actions = array();
Note: See TracChangeset
for help on using the changeset viewer.