Changeset 54070
- Timestamp:
- 09/05/2022 04:00:16 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-users-list-table.php
r53501 r54070 366 366 */ 367 367 public function get_columns() { 368 $c = array(368 $columns = array( 369 369 'cb' => '<input type="checkbox" />', 370 370 'username' => __( 'Username' ), … … 376 376 377 377 if ( $this->is_site_users ) { 378 unset( $c ['posts'] );379 } 380 381 return $c ;378 unset( $columns['posts'] ); 379 } 380 381 return $columns; 382 382 } 383 383 … … 390 390 */ 391 391 protected function get_sortable_columns() { 392 $c = array(392 $columns = array( 393 393 'username' => 'login', 394 394 'email' => 'email', 395 395 ); 396 396 397 return $c ;397 return $columns; 398 398 } 399 399 … … 538 538 $roles_list = implode( ', ', $user_roles ); 539 539 540 $r = "<tr id='user-$user_object->ID'>";540 $row = "<tr id='user-$user_object->ID'>"; 541 541 542 542 list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info(); … … 560 560 561 561 if ( 'cb' === $column_name ) { 562 $r .= "<th scope='row' class='check-column'>$checkbox</th>";562 $row .= "<th scope='row' class='check-column'>$checkbox</th>"; 563 563 } else { 564 $r .= "<td $attributes>";564 $row .= "<td $attributes>"; 565 565 switch ( $column_name ) { 566 566 case 'username': 567 $r .= "$avatar $edit";567 $row .= "$avatar $edit"; 568 568 break; 569 569 case 'name': 570 570 if ( $user_object->first_name && $user_object->last_name ) { 571 $r .= sprintf(571 $row .= sprintf( 572 572 /* translators: 1: User's first name, 2: Last name. */ 573 573 _x( '%1$s %2$s', 'Display name based on first name and last name' ), … … 576 576 ); 577 577 } elseif ( $user_object->first_name ) { 578 $r .= $user_object->first_name;578 $row .= $user_object->first_name; 579 579 } elseif ( $user_object->last_name ) { 580 $r .= $user_object->last_name;580 $row .= $user_object->last_name; 581 581 } else { 582 $r .= sprintf(582 $row .= sprintf( 583 583 '<span aria-hidden="true">—</span><span class="screen-reader-text">%s</span>', 584 584 _x( 'Unknown', 'name' ) … … 587 587 break; 588 588 case 'email': 589 $r .= "<a href='" . esc_url( "mailto:$email" ) . "'>$email</a>";589 $row .= "<a href='" . esc_url( "mailto:$email" ) . "'>$email</a>"; 590 590 break; 591 591 case 'role': 592 $r .= esc_html( $roles_list );592 $row .= esc_html( $roles_list ); 593 593 break; 594 594 case 'posts': 595 595 if ( $numposts > 0 ) { 596 $r .= sprintf(596 $row .= sprintf( 597 597 '<a href="%s" class="edit"><span aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></a>', 598 598 "edit.php?author={$user_object->ID}", … … 605 605 ); 606 606 } else { 607 $r .= 0;607 $row .= 0; 608 608 } 609 609 break; … … 618 618 * @param int $user_id ID of the currently-listed user. 619 619 */ 620 $r .= apply_filters( 'manage_users_custom_column', '', $column_name, $user_object->ID );620 $row .= apply_filters( 'manage_users_custom_column', '', $column_name, $user_object->ID ); 621 621 } 622 622 623 623 if ( $primary === $column_name ) { 624 $r .= $this->row_actions( $actions );624 $row .= $this->row_actions( $actions ); 625 625 } 626 $r .= '</td>';627 } 628 } 629 $r .= '</tr>';630 631 return $r ;626 $row .= '</td>'; 627 } 628 } 629 $row .= '</tr>'; 630 631 return $row; 632 632 } 633 633
Note: See TracChangeset
for help on using the changeset viewer.