Changeset 15500 for trunk/wp-admin/includes/default-list-tables.php
- Timestamp:
- 08/15/2010 10:36:17 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/default-list-tables.php
r15499 r15500 13 13 14 14 class WP_Posts_Table extends WP_List_Table { 15 15 16 16 /** 17 17 * Wether the items should be displayed hierarchically or linearly … … 19 19 * @since 3.1.0 20 20 * @var bool 21 * @access pr ivate21 * @access protected 22 22 */ 23 var $_hierarchical_display; 23 var $hierarchical_display; 24 25 /** 26 * Holds the number of pending comments for each post 27 * 28 * @since 3.1.0 29 * @var bool 30 * @access protected 31 */ 32 var $comment_pending_count; 24 33 25 34 function WP_Posts_Table() { … … 54 63 $avail_post_stati = wp_edit_posts_query(); 55 64 56 $this-> _hierarchical_display = ( $post_type_object->hierarchical && 0 === strpos( get_query_var( 'orderby' ), 'menu_order' ) );57 58 $total_items = $this-> _hierarchical_display ? $wp_query->post_count : $wp_query->found_posts;65 $this->hierarchical_display = ( $post_type_object->hierarchical && 0 === strpos( get_query_var( 'orderby' ), 'menu_order' ) ); 66 67 $total_items = $this->hierarchical_display ? $wp_query->post_count : $wp_query->found_posts; 59 68 60 69 $edit_per_page = 'edit_' . $post_type . '_per_page'; … … 65 74 $per_page = apply_filters( 'edit_posts_per_page', $per_page, $post_type ); 66 75 67 if ( $this-> _hierarchical_display )76 if ( $this->hierarchical_display ) 68 77 $total_pages = ceil( $total_items / $per_page ); 69 78 else … … 206 215 $posts = $wp_query->posts; 207 216 208 if ( $this-> _hierarchical_display ) {217 if ( $this->hierarchical_display ) { 209 218 $this->_display_rows_hierarchical( $posts, $this->get_pagenum(), $per_page ); 210 219 } else { … … 224 233 $post_ids[] = $a_post->ID; 225 234 226 $comment_pending_count = get_pending_comments_num( $post_ids ); 227 228 foreach ( $posts as $post ) { 229 if ( empty( $comment_pending_count[$post->ID] ) ) 230 $comment_pending_count[$post->ID] = 0; 231 232 $this->_single_row( $post, $comment_pending_count[$post->ID], $mode ); 233 } 235 $this->comment_pending_count = get_pending_comments_num( $post_ids ); 236 237 foreach ( $posts as $post ) 238 $this->single_row( $post ); 234 239 } 235 240 … … 285 290 286 291 if ( $count >= $start ) 287 echo "\t" . $this-> _single_row_hierarchical( $page, $level );292 echo "\t" . $this->single_row( $page, $level ); 288 293 289 294 $count++; … … 300 305 break; 301 306 if ( $count >= $start ) 302 echo "\t" . $this-> _single_row_hierarchical( $op, 0 );307 echo "\t" . $this->single_row( $op, 0 ); 303 308 $count++; 304 309 } … … 346 351 $num_parents = count( $my_parents ); 347 352 while ( $my_parent = array_pop( $my_parents ) ) { 348 echo "\t" . $this-> _single_row_hierarchical( $my_parent, $level - $num_parents );353 echo "\t" . $this->single_row( $my_parent, $level - $num_parents ); 349 354 $num_parents--; 350 355 } … … 352 357 353 358 if ( $count >= $start ) 354 echo "\t" . $this-> _single_row_hierarchical( $page, $level );359 echo "\t" . $this->single_row( $page, $level ); 355 360 356 361 $count++; … … 362 367 } 363 368 364 /** 365 * display one row if the page doesn't have any children 366 * otherwise, display the row and its children in subsequent rows 367 * 368 * @since unknown 369 * 370 * @param unknown_type $page 371 * @param unknown_type $level 372 */ 373 function _single_row_hierarchical( $page, $level = 0 ) { 374 global $post, $current_screen; 375 static $rowclass; 376 377 $post = $page; 378 setup_postdata( $page ); 379 380 if ( 0 == $level && (int) $page->post_parent > 0 ) { 381 //sent level 0 by accident, by default, or because we don't know the actual level 382 $find_main_page = (int) $page->post_parent; 383 while ( $find_main_page > 0 ) { 384 $parent = get_page( $find_main_page ); 385 386 if ( is_null( $parent ) ) 387 break; 388 389 $level++; 390 $find_main_page = (int) $parent->post_parent; 391 392 if ( !isset( $parent_name ) ) 393 $parent_name = $parent->post_title; 394 } 395 } 396 397 $page->post_title = esc_html( $page->post_title ); 398 $pad = str_repeat( '— ', $level ); 399 $id = (int) $page->ID; 400 $rowclass = 'alternate' == $rowclass ? '' : 'alternate'; 401 $title = _draft_or_post_title(); 402 $post_type = $page->post_type; 403 $post_type_object = get_post_type_object( $post_type ); 404 ?> 405 <tr id="post-<?php echo $id; ?>" class="<?php echo $rowclass; ?> iedit"> 406 <?php 407 408 list( $columns, $hidden ) = $this->get_column_headers(); 409 410 foreach ( $columns as $column_name => $column_display_name ) { 411 $class = "class=\"$column_name column-$column_name\""; 412 413 $style = ''; 414 if ( in_array( $column_name, $hidden ) ) 415 $style = ' style="display:none;"'; 416 417 $attributes = "$class$style"; 418 419 switch ( $column_name ) { 420 421 case 'cb': 422 ?> 423 <th scope="row" class="check-column"><?php if ( current_user_can( $post_type_object->cap->edit_post, $page->ID ) ) { ?><input type="checkbox" name="post[]" value="<?php the_ID(); ?>" /><?php } ?></th> 424 <?php 425 break; 426 case 'date': 427 if ( '0000-00-00 00:00:00' == $page->post_date && 'date' == $column_name ) { 428 $t_time = $h_time = __( 'Unpublished' ); 429 $time_diff = 0; 430 } else { 431 $t_time = get_the_time( __( 'Y/m/d g:i:s A' ) ); 432 $m_time = $page->post_date; 433 $time = get_post_time( 'G', true ); 434 435 $time_diff = time() - $time; 436 437 if ( $time_diff > 0 && $time_diff < 24*60*60 ) 438 $h_time = sprintf( __( '%s ago' ), human_time_diff( $time ) ); 439 else 440 $h_time = mysql2date( __( 'Y/m/d' ), $m_time ); 441 } 442 echo '<td ' . $attributes . '>'; 443 echo '<abbr title="' . $t_time . '">' . apply_filters( 'post_date_column_time', $h_time, $page, $column_name, '' ) . '</abbr>'; 444 echo '<br />'; 445 if ( 'publish' == $page->post_status ) { 446 _e( 'Published' ); 447 } elseif ( 'future' == $page->post_status ) { 448 if ( $time_diff > 0 ) 449 echo '<strong class="attention">' . __( 'Missed schedule' ) . '</strong>'; 450 else 451 _e( 'Scheduled' ); 452 } else { 453 _e( 'Last Modified' ); 454 } 455 echo '</td>'; 456 break; 457 case 'title': 458 $attributes = 'class="post-title page-title column-title"' . $style; 459 $edit_link = get_edit_post_link( $page->ID ); 460 ?> 461 <td <?php echo $attributes ?>><strong><?php if ( current_user_can( $post_type_object->cap->edit_post, $page->ID ) && $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( $page ); echo isset( $parent_name ) ? ' | ' . $post_type_object->labels->parent_item_colon . ' ' . esc_html( $parent_name ) : ''; ?></strong> 462 <?php 463 $actions = array(); 464 if ( current_user_can( $post_type_object->cap->edit_post, $page->ID ) && $post->post_status != 'trash' ) { 465 $actions['edit'] = '<a href="' . $edit_link . '" title="' . esc_attr( __( 'Edit this page' ) ) . '">' . __( 'Edit' ) . '</a>'; 466 $actions['inline'] = '<a href="#" class="editinline">' . __( 'Quick Edit' ) . '</a>'; 467 } 468 if ( current_user_can( $post_type_object->cap->delete_post, $page->ID ) ) { 469 if ( $post->post_status == 'trash' ) 470 $actions['untrash'] = "<a title='" . esc_attr( __( 'Remove this page from the Trash' ) ) . "' href='" . wp_nonce_url( "post.php?post_type=$post_type&action=untrash&post=$page->ID", 'untrash-' . $post->post_type . '_' . $page->ID ) . "'>" . __( 'Restore' ) . "</a>"; 471 elseif ( EMPTY_TRASH_DAYS ) 472 $actions['trash'] = "<a class='submitdelete' title='" . esc_attr( __( 'Move this page to the Trash' ) ) . "' href='" . get_delete_post_link( $page->ID ) . "'>" . __( 'Trash' ) . "</a>"; 473 if ( $post->post_status == 'trash' || !EMPTY_TRASH_DAYS ) 474 $actions['delete'] = "<a class='submitdelete' title='" . esc_attr( __( 'Delete this page permanently' ) ) . "' href='" . wp_nonce_url( "post.php?post_type=$post_type&action=delete&post=$page->ID", 'delete-' . $post->post_type . '_' . $page->ID ) . "'>" . __( 'Delete Permanently' ) . "</a>"; 475 } 476 if ( in_array( $post->post_status, array( 'pending', 'draft' ) ) ) { 477 if ( current_user_can( $post_type_object->cap->edit_post, $page->ID ) ) 478 $actions['view'] = '<a href="' . esc_url( add_query_arg( 'preview', 'true', get_permalink( $page->ID ) ) ) . '" title="' . esc_attr( sprintf( __( 'Preview “%s”' ), $title ) ) . '" rel="permalink">' . __( 'Preview' ) . '</a>'; 479 } elseif ( $post->post_status != 'trash' ) { 480 $actions['view'] = '<a href="' . get_permalink( $page->ID ) . '" title="' . esc_attr( sprintf( __( 'View “%s”' ), $title ) ) . '" rel="permalink">' . __( 'View' ) . '</a>'; 481 } 482 $actions = apply_filters( 'page_row_actions', $actions, $page ); 483 $action_count = count( $actions ); 484 485 $i = 0; 486 echo '<div class="row-actions">'; 487 foreach ( $actions as $action => $link ) { 488 ++$i; 489 ( $i == $action_count ) ? $sep = '' : $sep = ' | '; 490 echo "<span class='$action'>$link$sep</span>"; 491 } 492 echo '</div>'; 493 494 get_inline_data( $post ); 495 echo '</td>'; 496 break; 497 498 case 'comments': 499 ?> 500 <td <?php echo $attributes ?>><div class="post-com-count-wrapper"> 501 <?php 502 $left = get_pending_comments_num( $page->ID ); 503 $pending_phrase = sprintf( __( '%s pending' ), number_format( $left ) ); 504 if ( $left ) 505 echo '<strong>'; 506 comments_number( 507 "<a href='edit-comments.php?post_ID=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" 508 . /* translators: comment count link */ _x( '0', 'comment count' ) . '</span></a>', 509 "<a href='edit-comments.php?post_ID=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" 510 . /* translators: comment count link */ _x( '1', 'comment count' ) . '</span></a>', 511 "<a href='edit-comments.php?post_ID=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" 512 . /* translators: comment count link: % will be substituted by comment count */ _x( '%', 'comment count' ) . '</span></a>' 513 ); 514 if ( $left ) 515 echo '</strong>'; 516 ?> 517 </div></td> 518 <?php 519 break; 520 521 case 'author': 522 ?> 523 <td <?php echo $attributes ?>><a href="edit.php?post_type=<?php echo $post_type; ?>&author=<?php the_author_meta( 'ID' ); ?>"><?php the_author() ?></a></td> 524 <?php 525 break; 526 527 default: 528 ?> 529 <td <?php echo $attributes ?>><?php do_action( 'manage_pages_custom_column', $column_name, $id ); ?></td> 530 <?php 531 break; 532 } 533 } 534 ?> 535 536 </tr> 537 538 <?php 539 } 540 541 function _single_row( $a_post, $pending_comments, $mode ) { 542 global $post, $current_screen; 369 function single_row( $a_post, $level = 0 ) { 370 global $post, $current_screen, $mode; 543 371 static $rowclass; 544 372 … … 552 380 $title = _draft_or_post_title(); 553 381 $post_type_object = get_post_type_object( $post->post_type ); 382 $can_edit_post = current_user_can( 'edit_post', $post->ID ); 554 383 ?> 555 384 <tr id='post-<?php echo $post->ID; ?>' class='<?php echo trim( $rowclass . ' author-' . $post_owner . ' status-' . $post->post_status ); ?> iedit' valign="top"> … … 571 400 case 'cb': 572 401 ?> 573 <th scope="row" class="check-column"><?php if ( current_user_can( $post_type_object->cap->edit_post, $post->ID )) { ?><input type="checkbox" name="post[]" value="<?php the_ID(); ?>" /><?php } ?></th>402 <th scope="row" class="check-column"><?php if ( $can_edit_post ) { ?><input type="checkbox" name="post[]" value="<?php the_ID(); ?>" /><?php } ?></th> 574 403 <?php 404 break; 405 406 case 'title': 407 if ( $this->hierarchical_display ) { 408 $attributes = 'class="post-title page-title column-title"' . $style; 409 410 if ( 0 == $level && (int) $post->post_parent > 0 ) { 411 //sent level 0 by accident, by default, or because we don't know the actual level 412 $find_main_page = (int) $post->post_parent; 413 while ( $find_main_page > 0 ) { 414 $parent = get_page( $find_main_page ); 415 416 if ( is_null( $parent ) ) 417 break; 418 419 $level++; 420 $find_main_page = (int) $parent->post_parent; 421 422 if ( !isset( $parent_name ) ) 423 $parent_name = $parent->post_title; 424 } 425 } 426 427 $post->post_title = esc_html( $post->post_title ); 428 $pad = str_repeat( '— ', $level ); 429 ?> 430 <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> 431 <?php 432 } 433 else { 434 $attributes = 'class="post-title page-title column-title"' . $style; 435 ?> 436 <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 $title ?></a><?php } else { echo $title; }; _post_states( $post ); ?></strong> 437 <?php 438 if ( 'excerpt' == $mode ) { 439 the_excerpt(); 440 } 441 } 442 443 $actions = array(); 444 if ( $can_edit_post && 'trash' != $post->post_status ) { 445 $actions['edit'] = '<a href="' . get_edit_post_link( $post->ID, true ) . '" title="' . esc_attr( __( 'Edit this item' ) ) . '">' . __( 'Edit' ) . '</a>'; 446 $actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr( __( 'Edit this item inline' ) ) . '">' . __( 'Quick Edit' ) . '</a>'; 447 } 448 if ( current_user_can( $post_type_object->cap->delete_post, $post->ID ) ) { 449 if ( 'trash' == $post->post_status ) 450 $actions['untrash'] = "<a title='" . esc_attr( __( 'Restore this item from the Trash' ) ) . "' href='" . wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&action=untrash', $post->ID ) ), 'untrash-' . $post->post_type . '_' . $post->ID ) . "'>" . __( 'Restore' ) . "</a>"; 451 elseif ( EMPTY_TRASH_DAYS ) 452 $actions['trash'] = "<a class='submitdelete' title='" . esc_attr( __( 'Move this item to the Trash' ) ) . "' href='" . get_delete_post_link( $post->ID ) . "'>" . __( 'Trash' ) . "</a>"; 453 if ( 'trash' == $post->post_status || !EMPTY_TRASH_DAYS ) 454 $actions['delete'] = "<a class='submitdelete' title='" . esc_attr( __( 'Delete this item permanently' ) ) . "' href='" . get_delete_post_link( $post->ID, '', true ) . "'>" . __( 'Delete Permanently' ) . "</a>"; 455 } 456 if ( in_array( $post->post_status, array( 'pending', 'draft' ) ) ) { 457 if ( $can_edit_post ) 458 $actions['view'] = '<a href="' . esc_url( add_query_arg( 'preview', 'true', get_permalink( $post->ID ) ) ) . '" title="' . esc_attr( sprintf( __( 'Preview “%s”' ), $title ) ) . '" rel="permalink">' . __( 'Preview' ) . '</a>'; 459 } elseif ( 'trash' != $post->post_status ) { 460 $actions['view'] = '<a href="' . get_permalink( $post->ID ) . '" title="' . esc_attr( sprintf( __( 'View “%s”' ), $title ) ) . '" rel="permalink">' . __( 'View' ) . '</a>'; 461 } 462 463 $actions = apply_filters( $this->hierarchical_display ? 'page_row_actions' : 'post_row_actions', $actions, $post ); 464 $action_count = count( $actions ); 465 $i = 0; 466 echo '<div class="row-actions">'; 467 foreach ( $actions as $action => $link ) { 468 ++$i; 469 ( $i == $action_count ) ? $sep = '' : $sep = ' | '; 470 echo "<span class='$action'>$link$sep</span>"; 471 } 472 echo '</div>'; 473 474 get_inline_data( $post ); 575 475 break; 576 476 … … 611 511 break; 612 512 613 case 'title':614 $attributes = 'class="post-title column-title"' . $style;615 ?>616 <td <?php echo $attributes ?>><strong><?php if ( current_user_can( $post_type_object->cap->edit_post, $post->ID ) && $post->post_status != 'trash' ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo esc_attr( sprintf( __( 'Edit “%s”' ), $title ) ); ?>"><?php echo $title ?></a><?php } else { echo $title; }; _post_states( $post ); ?></strong>617 <?php618 if ( 'excerpt' == $mode )619 the_excerpt();620 621 $actions = array();622 if ( current_user_can( $post_type_object->cap->edit_post, $post->ID ) && 'trash' != $post->post_status ) {623 $actions['edit'] = '<a href="' . get_edit_post_link( $post->ID, true ) . '" title="' . esc_attr( __( 'Edit this item' ) ) . '">' . __( 'Edit' ) . '</a>';624 $actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr( __( 'Edit this item inline' ) ) . '">' . __( 'Quick Edit' ) . '</a>';625 }626 if ( current_user_can( $post_type_object->cap->delete_post, $post->ID ) ) {627 if ( 'trash' == $post->post_status )628 $actions['untrash'] = "<a title='" . esc_attr( __( 'Restore this item from the Trash' ) ) . "' href='" . wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&action=untrash', $post->ID ) ), 'untrash-' . $post->post_type . '_' . $post->ID ) . "'>" . __( 'Restore' ) . "</a>";629 elseif ( EMPTY_TRASH_DAYS )630 $actions['trash'] = "<a class='submitdelete' title='" . esc_attr( __( 'Move this item to the Trash' ) ) . "' href='" . get_delete_post_link( $post->ID ) . "'>" . __( 'Trash' ) . "</a>";631 if ( 'trash' == $post->post_status || !EMPTY_TRASH_DAYS )632 $actions['delete'] = "<a class='submitdelete' title='" . esc_attr( __( 'Delete this item permanently' ) ) . "' href='" . get_delete_post_link( $post->ID, '', true ) . "'>" . __( 'Delete Permanently' ) . "</a>";633 }634 if ( in_array( $post->post_status, array( 'pending', 'draft' ) ) ) {635 if ( current_user_can( $post_type_object->cap->edit_post, $post->ID ) )636 $actions['view'] = '<a href="' . esc_url( add_query_arg( 'preview', 'true', get_permalink( $post->ID ) ) ) . '" title="' . esc_attr( sprintf( __( 'Preview “%s”' ), $title ) ) . '" rel="permalink">' . __( 'Preview' ) . '</a>';637 } elseif ( 'trash' != $post->post_status ) {638 $actions['view'] = '<a href="' . get_permalink( $post->ID ) . '" title="' . esc_attr( sprintf( __( 'View “%s”' ), $title ) ) . '" rel="permalink">' . __( 'View' ) . '</a>';639 }640 $actions = apply_filters( 'post_row_actions', $actions, $post );641 $action_count = count( $actions );642 $i = 0;643 echo '<div class="row-actions">';644 foreach ( $actions as $action => $link ) {645 ++$i;646 ( $i == $action_count ) ? $sep = '' : $sep = ' | ';647 echo "<span class='$action'>$link$sep</span>";648 }649 echo '</div>';650 651 get_inline_data( $post );652 ?>653 </td>654 <?php655 break;656 657 513 case 'categories': 658 514 ?> … … 661 517 if ( !empty( $categories ) ) { 662 518 $out = array(); 663 foreach ( $categories as $c ) 664 $out[] = "<a href='edit.php?post_type={$post->post_type}&category_name={$c->slug}'> " . esc_html( sanitize_term_field( 'name', $c->name, $c->term_id, 'category', 'display' ) ) . '</a>'; 665 echo join( ', ', $out ); 519 foreach ( $categories as $c ) { 520 $out[] = sprintf( '<a href="%s">%s</a>', 521 add_query_arg( array( 'post_type' => $post->post_type, 'category_name' => $c->slug ), 'edit.php' ), 522 esc_html( sanitize_term_field( 'name', $c->name, $c->term_id, 'category', 'display' ) ) 523 ); 524 } 525 echo join( ', ', $out ); 666 526 } else { 667 527 _e( 'Uncategorized' ); … … 677 537 if ( !empty( $tags ) ) { 678 538 $out = array(); 679 foreach ( $tags as $c ) 680 $out[] = "<a href='edit.php?post_type={$post->post_type}&tag={$c->slug}'> " . esc_html( sanitize_term_field( 'name', $c->name, $c->term_id, 'post_tag', 'display' ) ) . '</a>'; 539 foreach ( $tags as $c ) { 540 $out[] = sprintf( '<a href="%s">%s</a>', 541 add_query_arg( array( 'post_type' => $post->post_type, 'tag' => $c->slug ), 'edit.php' ), 542 esc_html( sanitize_term_field( 'name', $c->name, $c->term_id, 'tag', 'display' ) ) 543 ); 544 } 681 545 echo join( ', ', $out ); 682 546 } else { … … 691 555 <td <?php echo $attributes ?>><div class="post-com-count-wrapper"> 692 556 <?php 557 $pending_comments = isset( $this->comment_pending_count[$post->ID] ) ? $this->comment_pending_count[$post->ID] : 0; 693 558 $pending_phrase = sprintf( __( '%s pending' ), number_format( $pending_comments ) ); 694 559 if ( $pending_comments ) … … 711 576 case 'author': 712 577 ?> 713 <td <?php echo $attributes ?>><a href="edit.php?post_type=<?php echo $post->post_type; ?>&author=<?php the_author_meta( 'ID' ); ?>"><?php the_author() ?></a></td> 714 <?php 715 break; 716 717 case 'control_view': 718 ?> 719 <td><a href="<?php the_permalink(); ?>" rel="permalink" class="view"><?php _e( 'View' ); ?></a></td> 720 <?php 721 break; 722 723 case 'control_edit': 724 ?> 725 <td><?php if ( current_user_can( $post_type_object->cap->edit_post, $post->ID ) ) { echo "<a href='$edit_link' class='edit'>" . __( 'Edit' ) . "</a>"; } ?></td> 726 <?php 727 break; 728 729 case 'control_delete': 730 ?> 731 <td><?php if ( current_user_can( $post_type_object->cap->delete_post, $post->ID ) ) { echo "<a href='" . wp_nonce_url( "post.php?action=delete&post=$id", 'delete-post_' . $post->ID ) . "' class='delete'>" . __( 'Delete' ) . "</a>"; } ?></td> 578 <td <?php echo $attributes ?>><?php 579 printf( '<a href="%s">%s</a>', 580 add_query_arg( array( 'post_type' => $post->post_type, 'author' => get_the_author_meta( 'ID' ) ), 'edit.php' ), 581 get_the_author() 582 ); 583 ?></td> 732 584 <?php 733 585 break;
Note: See TracChangeset
for help on using the changeset viewer.