- Timestamp:
- 05/29/2015 02:40:52 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-users-list-table.php
r32642 r32644 390 390 */ 391 391 $actions = apply_filters( 'user_row_actions', $actions, $user_object ); 392 $edit .= $this->row_actions( $actions );393 392 394 393 // Set up the checkbox ( because the user is editable, otherwise it's empty ) … … 404 403 $r = "<tr id='user-$user_object->ID'>"; 405 404 406 list( $columns, $hidden ) = $this->get_column_info();405 list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info(); 407 406 408 407 foreach ( $columns as $column_name => $column_display_name ) { 409 $class = "class=\"$column_name column-$column_name\""; 408 $classes = "$column_name column-$column_name"; 409 if ( $primary === $column_name ) { 410 $classes .= ' has-row-actions column-primary'; 411 } 410 412 411 413 $style = ''; 412 if ( in_array( $column_name, $hidden ) ) 414 if ( in_array( $column_name, $hidden ) ) { 413 415 $style = ' style="display:none;"'; 414 415 $attributes = "$class$style"; 416 417 switch ( $column_name ) { 418 case 'cb': 419 $r .= "<th scope='row' class='check-column'>$checkbox</th>"; 420 break; 421 case 'username': 422 $r .= "<td $attributes>$avatar $edit</td>"; 423 break; 424 case 'name': 425 $r .= "<td $attributes>$user_object->first_name $user_object->last_name</td>"; 426 break; 427 case 'email': 428 $r .= "<td $attributes><a href='mailto:$email' title='" . esc_attr( sprintf( __( 'E-mail: %s' ), $email ) ) . "'>$email</a></td>"; 429 break; 430 case 'role': 431 $r .= "<td $attributes>$role_name</td>"; 432 break; 433 case 'posts': 434 $attributes = 'class="posts column-posts num"' . $style; 435 $r .= "<td $attributes>"; 436 if ( $numposts > 0 ) { 437 $r .= "<a href='edit.php?author=$user_object->ID' title='" . esc_attr__( 'View posts by this author' ) . "' class='edit'>"; 438 $r .= $numposts; 439 $r .= '</a>'; 440 } else { 441 $r .= 0; 442 } 443 $r .= "</td>"; 444 break; 445 default: 446 $r .= "<td $attributes>"; 447 448 /** 449 * Filter the display output of custom columns in the Users list table. 450 * 451 * @since 2.8.0 452 * 453 * @param string $output Custom column output. Default empty. 454 * @param string $column_name Column name. 455 * @param int $user_id ID of the currently-listed user. 456 */ 457 $r .= apply_filters( 'manage_users_custom_column', '', $column_name, $user_object->ID ); 458 $r .= "</td>"; 416 } 417 418 $attributes = "class='$classes'$style"; 419 420 if ( 'cb' === $column_name ) { 421 $r .= "<th scope='row' class='check-column'>$checkbox</th>"; 422 } else { 423 $r .= "<td $attributes>"; 424 switch ( $column_name ) { 425 case 'username': 426 $r .= "$avatar $edit"; 427 break; 428 case 'name': 429 $r .= "$user_object->first_name $user_object->last_name"; 430 break; 431 case 'email': 432 $r .= "<a href='mailto:$email' title='" . esc_attr( sprintf( __( 'E-mail: %s' ), $email ) ) . "'>$email</a>"; 433 break; 434 case 'role': 435 $r .= $role_name; 436 break; 437 case 'posts': 438 $attributes = 'class="posts column-posts num"' . $style; 439 $r .= ""; 440 if ( $numposts > 0 ) { 441 $r .= "<a href='edit.php?author=$user_object->ID' title='" . esc_attr__( 'View posts by this author' ) . "' class='edit'>"; 442 $r .= $numposts; 443 $r .= '</a>'; 444 } else { 445 $r .= 0; 446 } 447 break; 448 default: 449 /** 450 * Filter the display output of custom columns in the Users list table. 451 * 452 * @since 2.8.0 453 * 454 * @param string $output Custom column output. Default empty. 455 * @param string $column_name Column name. 456 * @param int $user_id ID of the currently-listed user. 457 */ 458 $r .= apply_filters( 'manage_users_custom_column', '', $column_name, $user_object->ID ); 459 } 460 461 if ( $primary === $column_name ) { 462 $r .= $this->row_actions( $actions ); 463 } 464 $r .= "</td>"; 459 465 } 460 466 } … … 463 469 return $r; 464 470 } 471 472 /** 473 * Get name of default primary column 474 * 475 * @since 4.3.0 476 * @access protected 477 * 478 * @return string 479 */ 480 protected function get_default_primary_column_name() { 481 return 'username'; 482 } 465 483 }
Note: See TracChangeset
for help on using the changeset viewer.