Ticket #25408: 25408.diff
| File 25408.diff, 46.1 KB (added by , 12 years ago) |
|---|
-
class-wp-comments-list-table.php
273 273 ); 274 274 } 275 275 276 function get_primary_column() { 277 return( 'comment' ); 278 } 279 276 280 function display() { 277 281 extract( $this->_args ); 278 282 … … 381 385 </div> 382 386 <?php 383 387 } 384 385 if ( $user_can ) {386 // preorder it: Approve | Reply | Quick Edit | Edit | Spam | Trash387 $actions = array(388 'approve' => '', 'unapprove' => '',389 'reply' => '',390 'quickedit' => '',391 'edit' => '',392 'spam' => '', 'unspam' => '',393 'trash' => '', 'untrash' => '', 'delete' => ''394 );395 396 if ( $comment_status && 'all' != $comment_status ) { // not looking at all comments397 if ( 'approved' == $the_comment_status )398 $actions['unapprove'] = "<a href='$unapprove_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&new=unapproved' class='vim-u vim-destructive' title='" . esc_attr__( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';399 else if ( 'unapproved' == $the_comment_status )400 $actions['approve'] = "<a href='$approve_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&new=approved' class='vim-a vim-destructive' title='" . esc_attr__( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';401 } else {402 $actions['approve'] = "<a href='$approve_url' data-wp-lists='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved' class='vim-a' title='" . esc_attr__( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';403 $actions['unapprove'] = "<a href='$unapprove_url' data-wp-lists='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved' class='vim-u' title='" . esc_attr__( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';404 }405 406 if ( 'spam' != $the_comment_status && 'trash' != $the_comment_status ) {407 $actions['spam'] = "<a href='$spam_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID::spam=1' class='vim-s vim-destructive' title='" . esc_attr__( 'Mark this comment as spam' ) . "'>" . /* translators: mark as spam link */ _x( 'Spam', 'verb' ) . '</a>';408 } elseif ( 'spam' == $the_comment_status ) {409 $actions['unspam'] = "<a href='$unspam_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID:66cc66:unspam=1' class='vim-z vim-destructive'>" . _x( 'Not Spam', 'comment' ) . '</a>';410 } elseif ( 'trash' == $the_comment_status ) {411 $actions['untrash'] = "<a href='$untrash_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID:66cc66:untrash=1' class='vim-z vim-destructive'>" . __( 'Restore' ) . '</a>';412 }413 414 if ( 'spam' == $the_comment_status || 'trash' == $the_comment_status || !EMPTY_TRASH_DAYS ) {415 $actions['delete'] = "<a href='$delete_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID::delete=1' class='delete vim-d vim-destructive'>" . __( 'Delete Permanently' ) . '</a>';416 } else {417 $actions['trash'] = "<a href='$trash_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID::trash=1' class='delete vim-d vim-destructive' title='" . esc_attr__( 'Move this comment to the trash' ) . "'>" . _x( 'Trash', 'verb' ) . '</a>';418 }419 420 if ( 'spam' != $the_comment_status && 'trash' != $the_comment_status ) {421 $actions['edit'] = "<a href='comment.php?action=editcomment&c={$comment->comment_ID}' title='" . esc_attr__( 'Edit comment' ) . "'>". __( 'Edit' ) . '</a>';422 $actions['quickedit'] = '<a onclick="commentReply.open( \''.$comment->comment_ID.'\',\''.$post->ID.'\',\'edit\' );return false;" class="vim-q" title="'.esc_attr__( 'Quick Edit' ).'" href="#">' . __( 'Quick Edit' ) . '</a>';423 $actions['reply'] = '<a onclick="commentReply.open( \''.$comment->comment_ID.'\',\''.$post->ID.'\' );return false;" class="vim-r" title="'.esc_attr__( 'Reply to this comment' ).'" href="#">' . __( 'Reply' ) . '</a>';424 }425 426 $actions = apply_filters( 'comment_row_actions', array_filter( $actions ), $comment );427 428 $i = 0;429 echo '<div class="row-actions">';430 foreach ( $actions as $action => $link ) {431 ++$i;432 ( ( ( 'approve' == $action || 'unapprove' == $action ) && 2 === $i ) || 1 === $i ) ? $sep = '' : $sep = ' | ';433 434 // Reply and quickedit need a hide-if-no-js span when not added with ajax435 if ( ( 'reply' == $action || 'quickedit' == $action ) && ! defined('DOING_AJAX') )436 $action .= ' hide-if-no-js';437 elseif ( ( $action == 'untrash' && $the_comment_status == 'trash' ) || ( $action == 'unspam' && $the_comment_status == 'spam' ) ) {438 if ( '1' == get_comment_meta( $comment->comment_ID, '_wp_trash_meta_status', true ) )439 $action .= ' approve';440 else441 $action .= ' unapprove';442 }443 444 echo "<span class='$action'>$sep$link</span>";445 }446 echo '</div>';447 }448 388 } 449 389 450 390 function column_author( $comment ) { … … 512 452 function column_default( $comment, $column_name ) { 513 453 do_action( 'manage_comments_custom_column', $column_name, $comment->comment_ID ); 514 454 } 455 456 function handle_actions( $comment, $column_name, $primary ) { 457 global $comment_status; 458 $post = get_post(); 459 460 $user_can = $this->user_can; 461 462 $comment_url = esc_url( get_comment_link( $comment->comment_ID ) ); 463 $the_comment_status = wp_get_comment_status( $comment->comment_ID ); 464 465 if ( $user_can ) { 466 // preorder it: Approve | Reply | Quick Edit | Edit | Spam | Trash 467 $actions = array( 468 'approve' => '', 'unapprove' => '', 469 'reply' => '', 470 'quickedit' => '', 471 'edit' => '', 472 'spam' => '', 'unspam' => '', 473 'trash' => '', 'untrash' => '', 'delete' => '' 474 ); 475 476 if ( $comment_status && 'all' != $comment_status ) { // not looking at all comments 477 if ( 'approved' == $the_comment_status ) 478 $actions['unapprove'] = "<a href='$unapprove_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&new=unapproved' class='vim-u vim-destructive' title='" . esc_attr__( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>'; 479 else if ( 'unapproved' == $the_comment_status ) 480 $actions['approve'] = "<a href='$approve_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&new=approved' class='vim-a vim-destructive' title='" . esc_attr__( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>'; 481 } else { 482 $actions['approve'] = "<a href='$approve_url' data-wp-lists='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved' class='vim-a' title='" . esc_attr__( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>'; 483 $actions['unapprove'] = "<a href='$unapprove_url' data-wp-lists='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved' class='vim-u' title='" . esc_attr__( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>'; 484 } 485 486 if ( 'spam' != $the_comment_status && 'trash' != $the_comment_status ) { 487 $actions['spam'] = "<a href='$spam_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID::spam=1' class='vim-s vim-destructive' title='" . esc_attr__( 'Mark this comment as spam' ) . "'>" . /* translators: mark as spam link */ _x( 'Spam', 'verb' ) . '</a>'; 488 } elseif ( 'spam' == $the_comment_status ) { 489 $actions['unspam'] = "<a href='$unspam_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID:66cc66:unspam=1' class='vim-z vim-destructive'>" . _x( 'Not Spam', 'comment' ) . '</a>'; 490 } elseif ( 'trash' == $the_comment_status ) { 491 $actions['untrash'] = "<a href='$untrash_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID:66cc66:untrash=1' class='vim-z vim-destructive'>" . __( 'Restore' ) . '</a>'; 492 } 493 494 if ( 'spam' == $the_comment_status || 'trash' == $the_comment_status || !EMPTY_TRASH_DAYS ) { 495 $actions['delete'] = "<a href='$delete_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID::delete=1' class='delete vim-d vim-destructive'>" . __( 'Delete Permanently' ) . '</a>'; 496 } else { 497 $actions['trash'] = "<a href='$trash_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID::trash=1' class='delete vim-d vim-destructive' title='" . esc_attr__( 'Move this comment to the trash' ) . "'>" . _x( 'Trash', 'verb' ) . '</a>'; 498 } 499 500 if ( 'spam' != $the_comment_status && 'trash' != $the_comment_status ) { 501 $actions['edit'] = "<a href='comment.php?action=editcomment&c={$comment->comment_ID}' title='" . esc_attr__( 'Edit comment' ) . "'>". __( 'Edit' ) . '</a>'; 502 $actions['quickedit'] = '<a onclick="commentReply.open( \''.$comment->comment_ID.'\',\''.$post->ID.'\',\'edit\' );return false;" class="vim-q" title="'.esc_attr__( 'Quick Edit' ).'" href="#">' . __( 'Quick Edit' ) . '</a>'; 503 $actions['reply'] = '<a onclick="commentReply.open( \''.$comment->comment_ID.'\',\''.$post->ID.'\' );return false;" class="vim-r" title="'.esc_attr__( 'Reply to this comment' ).'" href="#">' . __( 'Reply' ) . '</a>'; 504 } 505 506 $actions = apply_filters( 'comment_row_actions', array_filter( $actions ), $comment ); 507 508 $i = 0; 509 echo '<div class="row-actions">'; 510 foreach ( $actions as $action => $link ) { 511 ++$i; 512 ( ( ( 'approve' == $action || 'unapprove' == $action ) && 2 === $i ) || 1 === $i ) ? $sep = '' : $sep = ' | '; 513 514 // Reply and quickedit need a hide-if-no-js span when not added with ajax 515 if ( ( 'reply' == $action || 'quickedit' == $action ) && ! defined('DOING_AJAX') ) 516 $action .= ' hide-if-no-js'; 517 elseif ( ( $action == 'untrash' && $the_comment_status == 'trash' ) || ( $action == 'unspam' && $the_comment_status == 'spam' ) ) { 518 if ( '1' == get_comment_meta( $comment->comment_ID, '_wp_trash_meta_status', true ) ) 519 $action .= ' approve'; 520 else 521 $action .= ' unapprove'; 522 } 523 524 echo "<span class='$action'>$sep$link</span>"; 525 } 526 echo '</div>'; 527 } 528 } 529 515 530 } 516 531 517 532 /** -
class-wp-list-table.php
600 600 } 601 601 602 602 /** 603 * Get name of primary column. 604 * 605 * @return string 606 */ 607 function get_primary_column() { 608 return( '' ); 609 } 610 611 /** 603 612 * Get a list of all, hidden and sortable columns, with filter applied 604 613 * 605 614 * @since 3.1.0 … … 628 637 $sortable[$id] = $data; 629 638 } 630 639 631 $ this->_column_headers = array( $columns, $hidden, $sortable);640 $primary = $this->get_primary_column(); 632 641 642 $this->_column_headers = array( $columns, $hidden, $sortable, $primary ); 643 633 644 return $this->_column_headers; 634 645 } 635 646 … … 849 860 * @param object $item The current item 850 861 */ 851 862 function single_row_columns( $item ) { 852 list( $columns, $hidden ) = $this->get_column_info(); 853 863 list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info(); 854 864 foreach ( $columns as $column_name => $column_display_name ) { 855 $class = "class='$column_name column-$column_name'"; 865 if ( $primary == $column_name ) { 866 $class = "class='$column_name column-$column_name has-row-actions'"; 867 } else { 868 $class = "class='$column_name column-$column_name'"; 869 } 856 870 857 871 $style = ''; 858 872 if ( in_array( $column_name, $hidden ) ) … … 868 882 elseif ( method_exists( $this, 'column_' . $column_name ) ) { 869 883 echo "<td $attributes>"; 870 884 echo call_user_func( array( $this, 'column_' . $column_name ), $item ); 885 if( $primary == $column_name ) { 886 echo $this->handle_actions( $item, $column_name, $primary ); 887 } 871 888 echo "</td>"; 872 889 } 873 890 else { … … 879 896 } 880 897 881 898 /** 899 * Generate and display row actions links 900 */ 901 function handle_actions( $post, $column_name, $primary_column ) { 902 } 903 904 /** 882 905 * Handle an incoming ajax request (called from admin-ajax.php) 883 906 * 884 907 * @since 3.1.0 -
class-wp-media-list-table.php
194 194 <tr id='post-<?php echo $post->ID; ?>' class='<?php echo trim( $alt . ' author-' . $post_owner . ' status-' . $post->post_status ); ?>' valign="top"> 195 195 <?php 196 196 197 list( $columns, $hidden ) = $this->get_column_info();197 list( $columns, $hidden, $sortable, $primary_column ) = $this->get_column_info(); 198 198 foreach ( $columns as $column_name => $column_display_name ) { 199 $class = "class='$column_name column-$column_name'";200 199 200 if( $primary_column == $column_name ) { 201 $class = "class='$column_name column-$column_name has-row-actions'"; 202 } else { 203 $class = "class='$column_name column-$column_name'"; 204 } 205 201 206 $style = ''; 202 207 if ( in_array( $column_name, $hidden ) ) 203 208 $style = ' style="display:none;"'; … … 257 262 ?> 258 263 </p> 259 264 <?php 260 echo $this->row_actions( $this->_get_row_actions( $post, $att_title ) ); 265 if( $primary_column == $column_name ) { 266 echo $this->row_actions( $this->_get_row_actions( $post, $att_title ) ); 267 } 261 268 ?> 262 269 </td> 263 270 <?php … … 270 277 esc_url( add_query_arg( array( 'author' => get_the_author_meta('ID') ), 'upload.php' ) ), 271 278 get_the_author() 272 279 ); 280 if( $primary_column == $column_name ) { 281 echo $this->row_actions( $this->_get_row_actions( $post, $att_title ) ); 282 } 273 283 ?></td> 274 284 <?php 275 285 break; … … 276 286 277 287 case 'desc': 278 288 ?> 279 <td <?php echo $attributes ?>><?php echo has_excerpt() ? $post->post_excerpt : ''; ?> </td>289 <td <?php echo $attributes ?>><?php echo has_excerpt() ? $post->post_excerpt : ''; ?> 280 290 <?php 291 if( $primary_column == $column_name ) { 292 echo $this->row_actions( $this->_get_row_actions( $post, $att_title ) ); 293 } 294 echo '</td>'; 281 295 break; 282 296 283 297 case 'date': … … 296 310 } 297 311 } 298 312 ?> 299 <td <?php echo $attributes ?>><?php echo $h_time ?> </td>313 <td <?php echo $attributes ?>><?php echo $h_time ?> 300 314 <?php 315 if( $primary_column == $column_name ) { 316 echo $this->row_actions( $this->_get_row_actions( $post, $att_title ) ); 317 } 318 echo '</td>'; 301 319 break; 302 320 303 321 case 'parent': … … 318 336 echo $title; 319 337 } ?></strong>, 320 338 <?php echo get_the_time( __( 'Y/m/d' ) ); ?> 321 </td>322 339 <?php 323 340 } else { 324 341 ?> … … 328 345 onclick="findPosts.open( 'media[]','<?php echo $post->ID ?>' ); return false;" 329 346 href="#the-list"> 330 347 <?php _e( 'Attach' ); ?></a> 331 <?php } ?> </td>348 <?php } ?> 332 349 <?php 333 350 } 351 if( $primary_column == $column_name ) { 352 echo $this->row_actions( $this->_get_row_actions( $post, $att_title ) ); 353 } 354 echo '</td>'; 334 355 break; 335 356 336 357 case 'comments': … … 344 365 $this->comments_bubble( $post->ID, $pending_comments ); 345 366 ?> 346 367 </div> 347 </td>348 368 <?php 369 if( $primary_column == $column_name ) { 370 echo $this->row_actions( $this->_get_row_actions( $post, $att_title ) ); 371 } 372 echo '</td>'; 349 373 break; 350 374 351 375 default: … … 378 402 } else { 379 403 echo '—'; 380 404 } 405 406 if( $primary_column == $column_name ) { 407 echo $this->row_actions( $this->_get_row_actions( $post, $att_title ) ); 408 } 381 409 echo '</td>'; 382 410 break; 383 411 } 384 412 ?> 385 413 <td <?php echo $attributes ?>> 386 <?php do_action( 'manage_media_custom_column', $column_name, $post->ID ); ?> 414 <?php 415 do_action( 'manage_media_custom_column', $column_name, $post->ID ); 416 if( $primary_column == $column_name ) { 417 echo $this->row_actions( $this->_get_row_actions( $post, $att_title ) ); 418 } 419 ?> 387 420 </td> 388 421 <?php 389 422 break; … … 394 427 <?php endwhile; 395 428 } 396 429 430 function get_primary_column() { 431 return( 'title' ); 432 } 433 397 434 function _get_row_actions( $post, $att_title ) { 398 435 $actions = array(); 399 436 -
class-wp-ms-sites-list-table.php
167 167 ); 168 168 } 169 169 170 function get_primary_column() { 171 return( 'blogname' ); 172 } 173 170 174 function display_rows() { 171 175 global $current_site, $mode; 172 176 … … 204 208 205 209 $blogname = ( is_subdomain_install() ) ? str_replace( '.'.$current_site->domain, '', $blog['domain'] ) : $blog['path']; 206 210 207 list( $columns, $hidden ) = $this->get_column_info();211 list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info(); 208 212 209 213 foreach ( $columns as $column_name => $column_display_name ) { 214 $is_primary = ( $primary == $column_name ); 210 215 $style = ''; 211 216 if ( in_array( $column_name, $hidden ) ) 212 217 $style = ' style="display:none;"'; … … 230 235 break; 231 236 232 237 case 'blogname': 233 echo "<td class='column-$column_name $column_name'$style>"; ?> 238 if( $is_primary ) { 239 echo "<td class='column-$column_name $column_name has-row-actions'$style>"; 240 } else { 241 echo "<td class='column-$column_name $column_name'$style>"; 242 } 243 ?> 234 244 <a href="<?php echo esc_url( network_admin_url( 'site-info.php?id=' . $blog['blog_id'] ) ); ?>" class="edit"><?php echo $blogname . $blog_state; ?></a> 235 245 <?php 236 246 if ( 'list' != $mode ) { … … 239 249 restore_current_blog(); 240 250 } 241 251 242 // Preordered. 243 $actions = array( 244 'edit' => '', 'backend' => '', 245 'activate' => '', 'deactivate' => '', 246 'archive' => '', 'unarchive' => '', 247 'spam' => '', 'unspam' => '', 248 'delete' => '', 249 'visit' => '', 250 ); 252 $this->handle_actions( $blog, $column_name, $primary ); 251 253 252 $actions['edit'] = '<span class="edit"><a href="' . esc_url( network_admin_url( 'site-info.php?id=' . $blog['blog_id'] ) ) . '">' . __( 'Edit' ) . '</a></span>';253 $actions['backend'] = "<span class='backend'><a href='" . esc_url( get_admin_url( $blog['blog_id'] ) ) . "' class='edit'>" . __( 'Dashboard' ) . '</a></span>';254 if ( $current_site->blog_id != $blog['blog_id'] ) {255 if ( get_blog_status( $blog['blog_id'], 'deleted' ) == '1' )256 $actions['activate'] = '<span class="activate"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=activateblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to activate the site %s' ), $blogname ) ) ), 'confirm' ) ) . '">' . __( 'Activate' ) . '</a></span>';257 else258 $actions['deactivate'] = '<span class="activate"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=deactivateblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to deactivate the site %s' ), $blogname ) ) ), 'confirm') ) . '">' . __( 'Deactivate' ) . '</a></span>';259 260 if ( get_blog_status( $blog['blog_id'], 'archived' ) == '1' )261 $actions['unarchive'] = '<span class="archive"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=unarchiveblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to unarchive the site %s.' ), $blogname ) ) ), 'confirm') ) . '">' . __( 'Unarchive' ) . '</a></span>';262 else263 $actions['archive'] = '<span class="archive"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=archiveblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to archive the site %s.' ), $blogname ) ) ), 'confirm') ) . '">' . _x( 'Archive', 'verb; site' ) . '</a></span>';264 265 if ( get_blog_status( $blog['blog_id'], 'spam' ) == '1' )266 $actions['unspam'] = '<span class="spam"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=unspamblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to unspam the site %s.' ), $blogname ) ) ), 'confirm') ) . '">' . _x( 'Not Spam', 'site' ) . '</a></span>';267 else268 $actions['spam'] = '<span class="spam"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=spamblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to mark the site %s as spam.' ), $blogname ) ) ), 'confirm') ) . '">' . _x( 'Spam', 'site' ) . '</a></span>';269 270 if ( current_user_can( 'delete_site', $blog['blog_id'] ) )271 $actions['delete'] = '<span class="delete"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=deleteblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to delete the site %s.' ), $blogname ) ) ), 'confirm') ) . '">' . __( 'Delete' ) . '</a></span>';272 }273 274 $actions['visit'] = "<span class='view'><a href='" . esc_url( get_home_url( $blog['blog_id'], '/' ) ) . "' rel='permalink'>" . __( 'Visit' ) . '</a></span>';275 276 $actions = apply_filters( 'manage_sites_action_links', array_filter( $actions ), $blog['blog_id'], $blogname );277 echo $this->row_actions( $actions );278 254 ?> 279 255 </td> 280 256 <?php … … 286 262 $date = 'Y/m/d'; 287 263 else 288 264 $date = 'Y/m/d \<\b\r \/\> g:i:s a'; 289 echo ( $blog['last_updated'] == '0000-00-00 00:00:00' ) ? __( 'Never' ) : mysql2date( $date, $blog['last_updated'] ); ?> 265 echo ( $blog['last_updated'] == '0000-00-00 00:00:00' ) ? __( 'Never' ) : mysql2date( $date, $blog['last_updated'] ); 266 $this->handle_actions( $blog, $column_name, $primary ); 267 ?> 290 268 </td> 291 269 <?php 292 270 break; … … 296 274 echo '—'; 297 275 else 298 276 echo mysql2date( $date, $blog['registered'] ); 277 278 $this->handle_actions( $blog, $column_name, $primary ); 299 279 ?> 300 280 </td> 301 281 <?php … … 318 298 if ( $blogusers_warning != '' ) 319 299 echo '<strong>' . $blogusers_warning . '</strong><br />'; 320 300 } 301 $this->handle_actions( $blog, $column_name, $primary ); 321 302 ?> 322 303 </td> 323 304 <?php … … 326 307 case 'plugins': ?> 327 308 <?php if ( has_filter( 'wpmublogsaction' ) ) { 328 309 echo "<td valign='top' class='$column_name column-$column_name'$style>"; 329 do_action( 'wpmublogsaction', $blog['blog_id'] ); ?> 310 do_action( 'wpmublogsaction', $blog['blog_id'] ); 311 $this->handle_actions( $blog, $column_name, $primary ); 312 ?> 330 313 </td> 331 314 <?php } 332 315 break; … … 334 317 default: 335 318 echo "<td class='$column_name column-$column_name'$style>"; 336 319 do_action( 'manage_sites_custom_column', $column_name, $blog['blog_id'] ); 320 $this->handle_actions( $blog, $column_name, $primary ); 337 321 echo "</td>"; 338 322 break; 339 323 } … … 343 327 <?php 344 328 } 345 329 } 330 331 function handle_actions( $blog, $column_name, $primary ) { 332 global $current_site; 333 if( $primary == $column_name ) { 334 $blogname = ( is_subdomain_install() ) ? str_replace( '.'.$current_site->domain, '', $blog['domain'] ) : $blog['path']; 335 // Preordered. 336 $actions = array( 337 'edit' => '', 'backend' => '', 338 'activate' => '', 'deactivate' => '', 339 'archive' => '', 'unarchive' => '', 340 'spam' => '', 'unspam' => '', 341 'delete' => '', 342 'visit' => '', 343 ); 344 345 $actions['edit'] = '<span class="edit"><a href="' . esc_url( network_admin_url( 'site-info.php?id=' . $blog['blog_id'] ) ) . '">' . __( 'Edit' ) . '</a></span>'; 346 $actions['backend'] = "<span class='backend'><a href='" . esc_url( get_admin_url( $blog['blog_id'] ) ) . "' class='edit'>" . __( 'Dashboard' ) . '</a></span>'; 347 if ( $current_site->blog_id != $blog['blog_id'] ) { 348 if ( get_blog_status( $blog['blog_id'], 'deleted' ) == '1' ) 349 $actions['activate'] = '<span class="activate"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=activateblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to activate the site %s' ), $blogname ) ) ), 'confirm' ) ) . '">' . __( 'Activate' ) . '</a></span>'; 350 else 351 $actions['deactivate'] = '<span class="activate"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=deactivateblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to deactivate the site %s' ), $blogname ) ) ), 'confirm') ) . '">' . __( 'Deactivate' ) . '</a></span>'; 352 353 if ( get_blog_status( $blog['blog_id'], 'archived' ) == '1' ) 354 $actions['unarchive'] = '<span class="archive"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=unarchiveblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to unarchive the site %s.' ), $blogname ) ) ), 'confirm') ) . '">' . __( 'Unarchive' ) . '</a></span>'; 355 else 356 $actions['archive'] = '<span class="archive"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=archiveblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to archive the site %s.' ), $blogname ) ) ), 'confirm') ) . '">' . _x( 'Archive', 'verb; site' ) . '</a></span>'; 357 358 if ( get_blog_status( $blog['blog_id'], 'spam' ) == '1' ) 359 $actions['unspam'] = '<span class="spam"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=unspamblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to unspam the site %s.' ), $blogname ) ) ), 'confirm') ) . '">' . _x( 'Not Spam', 'site' ) . '</a></span>'; 360 else 361 $actions['spam'] = '<span class="spam"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=spamblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to mark the site %s as spam.' ), $blogname ) ) ), 'confirm') ) . '">' . _x( 'Spam', 'site' ) . '</a></span>'; 362 363 if ( current_user_can( 'delete_site', $blog['blog_id'] ) ) 364 $actions['delete'] = '<span class="delete"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=deleteblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to delete the site %s.' ), $blogname ) ) ), 'confirm') ) . '">' . __( 'Delete' ) . '</a></span>'; 365 } 366 367 $actions['visit'] = "<span class='view'><a href='" . esc_url( get_home_url( $blog['blog_id'], '/' ) ) . "' rel='permalink'>" . __( 'Visit' ) . '</a></span>'; 368 369 $actions = apply_filters( 'manage_sites_action_links', array_filter( $actions ), $blog['blog_id'], $blogname ); 370 echo $this->row_actions( $actions ); 371 } 372 } 346 373 } -
class-wp-ms-themes-list-table.php
182 182 ); 183 183 } 184 184 185 function get_primary_column() { 186 return( 'name' ); 187 } 188 185 189 function get_views() { 186 190 global $totals, $status; 187 191 … … 298 302 299 303 echo "<tr id='$id' class='$class'>"; 300 304 301 list( $columns, $hidden ) = $this->get_column_info();305 list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info(); 302 306 303 307 foreach ( $columns as $column_name => $column_display_name ) { 308 $is_primary = ( $primary == $column_name ); 304 309 $style = ''; 305 310 if ( in_array( $column_name, $hidden ) ) 306 311 $style = ' style="display:none;"'; … … 311 316 break; 312 317 case 'name': 313 318 echo "<td class='theme-title'$style><strong>" . $theme->display('Name') . "</strong>"; 314 echo $this->row_actions( $actions, true );319 if( $is_primary ) echo $this->row_actions( $actions, true ); 315 320 echo "</td>"; 316 321 break; 317 322 case 'description': … … 335 340 336 341 $theme_meta = apply_filters( 'theme_row_meta', $theme_meta, $stylesheet, $theme, $status ); 337 342 echo implode( ' | ', $theme_meta ); 343 echo "</div>"; 338 344 339 echo "</div></td>"; 345 if( $is_primary ) echo $this->row_actions( $actions, true ); 346 echo "</td>"; 340 347 break; 341 348 342 349 default: 343 350 echo "<td class='$column_name column-$column_name'$style>"; 344 351 do_action( 'manage_themes_custom_column', $column_name, $stylesheet, $theme ); 352 if( $is_primary ) echo $this->row_actions( $actions, true ); 345 353 echo "</td>"; 346 354 } 347 355 } -
class-wp-ms-users-list-table.php
132 132 ); 133 133 } 134 134 135 function get_primary_column() { 136 return( 'username' ); 137 } 138 135 139 function display_rows() { 136 140 global $current_site, $mode; 137 141 … … 151 155 <tr class="<?php echo $alt; ?>"> 152 156 <?php 153 157 154 list( $columns, $hidden ) = $this->get_column_info();158 list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info(); 155 159 156 160 foreach ( $columns as $column_name => $column_display_name ) : 157 $class = "class='$column_name column-$column_name'"; 161 $is_primary = ($primary == $column_name); 162 if( $is_primary ) { 163 $class = "class='$column_name column-$column_name has-row-actions'"; 164 } else { 165 $class = "class='$column_name column-$column_name'"; 166 } 158 167 159 168 $style = ''; 160 169 if ( in_array( $column_name, $hidden ) ) … … 182 191 ?></strong> 183 192 <br/> 184 193 <?php 185 $actions = array(); 186 $actions['edit'] = '<a href="' . $edit_link . '">' . __( 'Edit' ) . '</a>'; 187 188 if ( current_user_can( 'delete_user', $user->ID ) && ! in_array( $user->user_login, $super_admins ) ) { 189 $actions['delete'] = '<a href="' . $delete = esc_url( network_admin_url( add_query_arg( '_wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), wp_nonce_url( 'users.php', 'deleteuser' ) . '&action=deleteuser&id=' . $user->ID ) ) ) . '" class="delete">' . __( 'Delete' ) . '</a>'; 190 } 191 192 $actions = apply_filters( 'ms_user_row_actions', $actions, $user ); 193 echo $this->row_actions( $actions ); 194 $this->handle_actions( $user, $column_name, $primary ); 194 195 ?> 195 196 </td> 196 197 <?php … … 197 198 break; 198 199 199 200 case 'name': 200 echo "<td $attributes>$user->first_name $user->last_name</td>"; 201 echo "<td $attributes>$user->first_name $user->last_name"; 202 $this->handle_actions( $user, $column_name, $primary ); 203 echo "</td>"; 201 204 break; 202 205 203 206 case 'email': 204 echo "<td $attributes><a href='mailto:$user->user_email'>$user->user_email</a></td>"; 207 echo "<td $attributes><a href='mailto:$user->user_email'>$user->user_email</a>"; 208 $this->handle_actions( $user, $column_name, $primary ); 209 echo "</td>"; 205 210 break; 206 211 207 212 case 'registered': … … 210 215 else 211 216 $date = 'Y/m/d \<\b\r \/\> g:i:s a'; 212 217 213 echo "<td $attributes>" . mysql2date( $date, $user->user_registered ) . "</td>"; 218 echo "<td $attributes>" . mysql2date( $date, $user->user_registered ); 219 $this->handle_actions( $user, $column_name, $primary ); 220 echo "</td>"; 214 221 break; 215 222 216 223 case 'blogs': … … 252 259 echo '</small></span><br/>'; 253 260 } 254 261 } 262 $this->handle_actions( $user, $column_name, $primary ); 255 263 ?> 256 264 </td> 257 265 <?php … … 260 268 default: 261 269 echo "<td $attributes>"; 262 270 echo apply_filters( 'manage_users_custom_column', '', $column_name, $user->ID ); 271 $this->handle_actions( $user, $column_name, $primary ); 263 272 echo "</td>"; 264 273 break; 265 274 } … … 269 278 <?php 270 279 } 271 280 } 281 282 283 function handle_actions( $user, $column_name, $primary ) { 284 $super_admins = get_super_admins(); 285 if( $primary == $column_name ) { 286 $actions = array(); 287 $actions['edit'] = '<a href="' . $edit_link . '">' . __( 'Edit' ) . '</a>'; 288 289 if ( current_user_can( 'delete_user', $user->ID ) && ! in_array( $user->user_login, $super_admins ) ) { 290 $actions['delete'] = '<a href="' . $delete = esc_url( network_admin_url( add_query_arg( '_wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), wp_nonce_url( 'users.php', 'deleteuser' ) . '&action=deleteuser&id=' . $user->ID ) ) ) . '" class="delete">' . __( 'Delete' ) . '</a>'; 291 } 292 293 $actions = apply_filters( 'ms_user_row_actions', $actions, $user ); 294 echo $this->row_actions( $actions ); 295 } 296 } 297 272 298 } -
class-wp-plugins-list-table.php
384 384 385 385 echo "<tr id='$id' class='$class'>"; 386 386 387 list( $columns, $hidden ) = $this->get_column_info();387 list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info(); 388 388 389 389 foreach ( $columns as $column_name => $column_display_name ) { 390 390 $style = ''; … … 396 396 echo "<th scope='row' class='check-column'>$checkbox</th>"; 397 397 break; 398 398 case 'name': 399 echo "<td class='plugin-title'$style><strong>$plugin_name</strong>"; 400 echo $this->row_actions( $actions, true ); 399 if( $primary == $column_name ) { 400 echo "<td class='plugin-title has-row-actions'$style><strong>$plugin_name</strong>"; 401 echo $this->row_actions( $actions, true ); 402 } else { 403 echo "<td class='plugin-title'$style><strong>$plugin_name</strong>"; 404 } 401 405 echo "</td>"; 402 406 break; 403 407 case 'description': 404 echo "<td class='column-description desc'$style> 405 <div class='plugin-description'>$description</div> 406 <div class='$class second plugin-version-author-uri'>"; 408 if( $primary == $column_name ) { 409 echo "<td class='column-description desc has-row-actions'$style>"; 410 } else { 411 echo "<td class='column-description desc'$style>"; 412 } 413 echo "<div class='plugin-description'>$description</div> 414 <div class='$class second plugin-version-author-uri'>"; 407 415 408 416 $plugin_meta = array(); 409 417 if ( !empty( $plugin_data['Version'] ) ) … … 420 428 $plugin_meta = apply_filters( 'plugin_row_meta', $plugin_meta, $plugin_file, $plugin_data, $status ); 421 429 echo implode( ' | ', $plugin_meta ); 422 430 431 if( $primary == $column_name ) { 432 echo $this->row_actions( $actions, true ); 433 } 423 434 echo "</div></td>"; 424 435 break; 425 436 default: … … 434 445 do_action( 'after_plugin_row', $plugin_file, $plugin_data, $status ); 435 446 do_action( "after_plugin_row_$plugin_file", $plugin_file, $plugin_data, $status ); 436 447 } 448 449 function get_primary_column() { 450 return( 'name' ); 451 } 437 452 } -
class-wp-posts-list-table.php
495 495 <tr id="post-<?php echo $post->ID; ?>" class="<?php echo implode( ' ', get_post_class( $classes, $post->ID ) ); ?>" valign="top"> 496 496 <?php 497 497 498 list( $columns, $hidden ) = $this->get_column_info();498 list( $columns, $hidden, $sortable, $primary_column ) = $this->get_column_info(); 499 499 500 500 foreach ( $columns as $column_name => $column_display_name ) { 501 $class = "class=\"$column_name column-$column_name\"";502 501 502 if ( $primary_column == $column_name ) { 503 $class = "class=\"$column_name column-$column_name has-row-actions\""; 504 } else { 505 $class = "class=\"$column_name column-$column_name\""; 506 } 507 503 508 $style = ''; 504 509 if ( in_array( $column_name, $hidden ) ) 505 510 $style = ' style="display:none;"'; … … 526 531 break; 527 532 528 533 case 'title': 529 $attributes = 'class="post-title page-title column-title"' . $style; 534 if ( $primary_column == $column_name ) { 535 $attributes = 'class="post-title page-title column-title has_row_actions"'; 536 } else { 537 $attributes = 'class="post-title page-title column-title"'; 538 } 539 $attributes .= $style; 540 530 541 if ( $this->hierarchical_display ) { 531 542 if ( 0 == $level && (int) $post->post_parent > 0 ) { 532 543 //sent level 0 by accident, by default, or because we don't know the actual level … … 581 592 if ( ! $this->hierarchical_display && 'excerpt' == $mode && current_user_can( 'read_post', $post->ID ) ) 582 593 the_excerpt(); 583 594 595 /* 584 596 $actions = array(); 585 597 if ( $can_edit_post && 'trash' != $post->post_status ) { 586 598 $actions['edit'] = '<a href="' . get_edit_post_link( $post->ID, true ) . '" title="' . esc_attr( __( 'Edit this item' ) ) . '">' . __( 'Edit' ) . '</a>'; … … 605 617 606 618 $actions = apply_filters( is_post_type_hierarchical( $post->post_type ) ? 'page_row_actions' : 'post_row_actions', $actions, $post ); 607 619 echo $this->row_actions( $actions ); 620 */ 621 $this->handle_actions( $post, $column_name, $primary_column ); 608 622 609 623 get_inline_data( $post ); 610 624 echo '</td>'; … … 643 657 } else { 644 658 _e( 'Last Modified' ); 645 659 } 660 $this->handle_actions( $post, $column_name, $primary_column ); 646 661 echo '</td>'; 647 662 break; 648 663 … … 654 669 655 670 $this->comments_bubble( $post->ID, $pending_comments ); 656 671 ?> 657 </div> </td>672 </div> <?php $this->handle_actions( $post, $column_name, $primary_column ); ?> </td> 658 673 <?php 659 674 break; 660 675 … … 665 680 esc_url( add_query_arg( array( 'post_type' => $post->post_type, 'author' => get_the_author_meta( 'ID' ) ), 'edit.php' )), 666 681 get_the_author() 667 682 ); 683 $this->handle_actions( $post, $column_name, $primary_column ); 668 684 ?></td> 669 685 <?php 670 686 break; … … 705 721 } else { 706 722 echo '—'; 707 723 } 724 725 $this->handle_actions( $post, $column_name, $primary_column ); 708 726 echo '</td>'; 709 727 break; 710 728 } … … 715 733 else 716 734 do_action( 'manage_posts_custom_column', $column_name, $post->ID ); 717 735 do_action( "manage_{$post->post_type}_posts_custom_column", $column_name, $post->ID ); 736 $this->handle_actions( $post, $column_name, $primary_column ); 718 737 ?></td> 719 738 <?php 720 739 break; … … 726 745 $GLOBALS['post'] = $global_post; 727 746 } 728 747 748 function get_primary_column() { 749 return( 'title' ); 750 } 751 752 function handle_actions( $post, $column_name, $primary_column ) { 753 if ( $primary_column == $column_name ) { 754 $post_type_object = get_post_type_object( $post->post_type ); 755 $can_edit_post = current_user_can( 'edit_post', $post->ID ); 756 $actions = array(); 757 if ( $can_edit_post && 'trash' != $post->post_status ) { 758 $actions['edit'] = '<a href="' . get_edit_post_link( $post->ID, true ) . '" title="' . esc_attr( __( 'Edit this item' ) ) . '">' . __( 'Edit' ) . '</a>'; 759 $actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr( __( 'Edit this item inline' ) ) . '">' . __( 'Quick Edit' ) . '</a>'; 760 } 761 if ( current_user_can( 'delete_post', $post->ID ) ) { 762 if ( 'trash' == $post->post_status ) 763 $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->ID ) . "'>" . __( 'Restore' ) . "</a>"; 764 elseif ( EMPTY_TRASH_DAYS ) 765 $actions['trash'] = "<a class='submitdelete' title='" . esc_attr( __( 'Move this item to the Trash' ) ) . "' href='" . get_delete_post_link( $post->ID ) . "'>" . __( 'Trash' ) . "</a>"; 766 if ( 'trash' == $post->post_status || !EMPTY_TRASH_DAYS ) 767 $actions['delete'] = "<a class='submitdelete' title='" . esc_attr( __( 'Delete this item permanently' ) ) . "' href='" . get_delete_post_link( $post->ID, '', true ) . "'>" . __( 'Delete Permanently' ) . "</a>"; 768 } 769 if ( $post_type_object->public ) { 770 if ( in_array( $post->post_status, array( 'pending', 'draft', 'future' ) ) ) { 771 if ( $can_edit_post ) 772 $actions['view'] = '<a href="' . esc_url( apply_filters( 'preview_post_link', set_url_scheme( add_query_arg( 'preview', 'true', get_permalink( $post->ID ) ) ) ) ) . '" title="' . esc_attr( sprintf( __( 'Preview “%s”' ), $title ) ) . '" rel="permalink">' . __( 'Preview' ) . '</a>'; 773 } elseif ( 'trash' != $post->post_status ) { 774 $actions['view'] = '<a href="' . get_permalink( $post->ID ) . '" title="' . esc_attr( sprintf( __( 'View “%s”' ), $title ) ) . '" rel="permalink">' . __( 'View' ) . '</a>'; 775 } 776 } 777 778 $actions = apply_filters( is_post_type_hierarchical( $post->post_type ) ? 'page_row_actions' : 'post_row_actions', $actions, $post ); 779 echo $this->row_actions( $actions ); 780 } 781 } 782 729 783 /** 730 784 * Outputs the hidden row displayed when inline editing 731 785 * -
class-wp-terms-list-table.php
252 252 253 253 $out = '<strong><a class="row-title" href="' . $edit_link . '" title="' . esc_attr( sprintf( __( 'Edit “%s”' ), $name ) ) . '">' . $name . '</a></strong><br />'; 254 254 255 $actions = array();256 if ( current_user_can( $tax->cap->edit_terms ) ) {257 $actions['edit'] = '<a href="' . $edit_link . '">' . __( 'Edit' ) . '</a>';258 $actions['inline hide-if-no-js'] = '<a href="#" class="editinline">' . __( 'Quick Edit' ) . '</a>';259 }260 if ( current_user_can( $tax->cap->delete_terms ) && $tag->term_id != $default_term )261 $actions['delete'] = "<a class='delete-tag' href='" . wp_nonce_url( "edit-tags.php?action=delete&taxonomy=$taxonomy&tag_ID=$tag->term_id", 'delete-tag_' . $tag->term_id ) . "'>" . __( 'Delete' ) . "</a>";262 if ( $tax->public )263 $actions['view'] = '<a href="' . get_term_link( $tag ) . '">' . __( 'View' ) . '</a>';264 265 $actions = apply_filters( 'tag_row_actions', $actions, $tag );266 $actions = apply_filters( "{$taxonomy}_row_actions", $actions, $tag );267 268 $out .= $this->row_actions( $actions );269 255 $out .= '<div class="hidden" id="inline_' . $qe_data->term_id . '">'; 270 256 $out .= '<div class="name">' . $qe_data->name . '</div>'; 271 257 $out .= '<div class="slug">' . apply_filters( 'editable_slug', $qe_data->slug ) . '</div>'; … … 317 303 return apply_filters( "manage_{$this->screen->taxonomy}_custom_column", '', $column_name, $tag->term_id ); 318 304 } 319 305 306 function get_primary_column() { 307 return( 'name' ); 308 } 309 310 function handle_actions( $tag, $column_name, $primary_column ) { 311 $taxonomy = $this->screen->taxonomy; 312 $tax = get_taxonomy( $taxonomy ); 313 314 $default_term = get_option( 'default_' . $taxonomy ); 315 316 $pad = str_repeat( '— ', max( 0, $this->level ) ); 317 $name = apply_filters( 'term_name', $pad . ' ' . $tag->name, $tag ); 318 $qe_data = get_term( $tag->term_id, $taxonomy, OBJECT, 'edit' ); 319 $edit_link = esc_url( get_edit_term_link( $tag->term_id, $taxonomy, $this->screen->post_type ) ); 320 $actions = array(); 321 if ( current_user_can( $tax->cap->edit_terms ) ) { 322 $actions['edit'] = '<a href="' . $edit_link . '">' . __( 'Edit' ) . '</a>'; 323 $actions['inline hide-if-no-js'] = '<a href="#" class="editinline">' . __( 'Quick Edit' ) . '</a>'; 324 } 325 if ( current_user_can( $tax->cap->delete_terms ) && $tag->term_id != $default_term ) 326 $actions['delete'] = "<a class='delete-tag' href='" . wp_nonce_url( "edit-tags.php?action=delete&taxonomy=$taxonomy&tag_ID=$tag->term_id", 'delete-tag_' . $tag->term_id ) . "'>" . __( 'Delete' ) . "</a>"; 327 if ( $tax->public ) 328 $actions['view'] = '<a href="' . get_term_link( $tag ) . '">' . __( 'View' ) . '</a>'; 329 330 $actions = apply_filters( 'tag_row_actions', $actions, $tag ); 331 $actions = apply_filters( "{$taxonomy}_row_actions", $actions, $tag ); 332 333 echo $this->row_actions( $actions ); 334 } 335 320 336 /** 321 337 * Outputs the hidden row displayed when inline editing 322 338 * -
class-wp-users-list-table.php
258 258 if ( is_multisite() && get_current_user_id() != $user_object->ID && current_user_can( 'remove_user', $user_object->ID ) ) 259 259 $actions['remove'] = "<a class='submitdelete' href='" . wp_nonce_url( $url."action=remove&user=$user_object->ID", 'bulk-users' ) . "'>" . __( 'Remove' ) . "</a>"; 260 260 $actions = apply_filters( 'user_row_actions', $actions, $user_object ); 261 $edit .= $this->row_actions( $actions );262 261 263 262 // Set up the checkbox ( because the user is editable, otherwise it's empty ) 264 263 $checkbox = '<label class="screen-reader-text" for="cb-select-' . $user_object->ID . '">' . sprintf( __( 'Select %s' ), $user_object->user_login ) . '</label>' … … 272 271 273 272 $r = "<tr id='user-$user_object->ID'$style>"; 274 273 275 list( $columns, $hidden ) = $this->get_column_info();274 list( $columns, $hidden, $sortable, $primary_column ) = $this->get_column_info(); 276 275 277 276 foreach ( $columns as $column_name => $column_display_name ) { 278 $class = "class=\"$column_name column-$column_name\"";279 277 278 if( $primary_column == $column_name ) { 279 $class = "class=\"$column_name column-$column_name has-row-actions\""; 280 } else { 281 $class = "class=\"$column_name column-$column_name\""; 282 } 283 280 284 $style = ''; 281 285 if ( in_array( $column_name, $hidden ) ) 282 286 $style = ' style="display:none;"'; … … 288 292 $r .= "<th scope='row' class='check-column'>$checkbox</th>"; 289 293 break; 290 294 case 'username': 291 $r .= "<td $attributes>$avatar $edit </td>";295 $r .= "<td $attributes>$avatar $edit"; 292 296 break; 293 297 case 'name': 294 $r .= "<td $attributes>$user_object->first_name $user_object->last_name </td>";298 $r .= "<td $attributes>$user_object->first_name $user_object->last_name"; 295 299 break; 296 300 case 'email': 297 $r .= "<td $attributes><a href='mailto:$email' title='" . esc_attr( sprintf( __( 'E-mail: %s' ), $email ) ) . "'>$email</a> </td>";301 $r .= "<td $attributes><a href='mailto:$email' title='" . esc_attr( sprintf( __( 'E-mail: %s' ), $email ) ) . "'>$email</a>"; 298 302 break; 299 303 case 'role': 300 $r .= "<td $attributes>$role_name </td>";304 $r .= "<td $attributes>$role_name"; 301 305 break; 302 306 case 'posts': 303 307 $attributes = 'class="posts column-posts num"' . $style; … … 309 313 } else { 310 314 $r .= 0; 311 315 } 312 $r .= "</td>";313 316 break; 314 317 default: 315 318 $r .= "<td $attributes>"; … … 316 319 $r .= apply_filters( 'manage_users_custom_column', '', $column_name, $user_object->ID ); 317 320 $r .= "</td>"; 318 321 } 322 323 if( $primary_column == $column_name ) { 324 $r .= $this->row_actions( $actions ); 325 } 326 $r .= '</td>'; 319 327 } 320 328 $r .= '</tr>'; 321 329 322 330 return $r; 323 331 } 332 333 function get_primary_column() { 334 return( 'username' ); 335 } 324 336 }