* @access public
*/
public function no_items() {
- _e( 'No matching users were found.' );
+ _e( 'No users found.' );
}
/**
$editable_roles = array_keys( get_editable_roles() );
- $style = '';
foreach ( $this->items as $userid => $user_object ) {
if ( count( $user_object->roles ) <= 1 ) {
$role = reset( $user_object->roles );
if ( is_multisite() && empty( $user_object->allcaps ) )
continue;
- $style = ( ' class="alternate"' == $style ) ? '' : ' class="alternate"';
- echo "\n\t" . $this->single_row( $user_object, $style, $role, isset( $post_counts ) ? $post_counts[ $userid ] : 0 );
+ echo "\n\t" . $this->single_row( $user_object, $style = '', $role, isset( $post_counts ) ? $post_counts[ $userid ] : 0 );
}
}
* Generate HTML for a single row on the users.php admin panel.
*
* @since 3.1.0
+ * @since 4.2.0 The `$style` argument was deprecated.
* @access public
*
+ * @global WP_Roles $wp_roles User roles object.
+ *
* @param object $user_object The current user object.
- * @param string $style Optional. Style attributes added to the `<tr>` element.
- * Must be sanitized. Default empty.
+ * @param string $style Deprecated. Not used.
* @param string $role Optional. Key for the $wp_roles array. Default empty.
* @param int $numposts Optional. Post count to display for this user. Defaults
* to zero, as in, a new user has made zero posts.
public function single_row( $user_object, $style = '', $role = '', $numposts = 0 ) {
global $wp_roles;
- if ( !( is_object( $user_object ) && is_a( $user_object, 'WP_User' ) ) )
+ if ( ! ( $user_object instanceof WP_User ) ) {
$user_object = get_userdata( (int) $user_object );
+ }
$user_object->filter = 'display';
$email = $user_object->user_email;
$edit .= $this->row_actions( $actions );
// Set up the checkbox ( because the user is editable, otherwise it's empty )
- $checkbox = '<label class="screen-reader-text" for="cb-select-' . $user_object->ID . '">' . sprintf( __( 'Select %s' ), $user_object->user_login ) . '</label>'
+ $checkbox = '<label class="screen-reader-text" for="user_' . $user_object->ID . '">' . sprintf( __( 'Select %s' ), $user_object->user_login ) . '</label>'
. "<input type='checkbox' name='users[]' id='user_{$user_object->ID}' class='$role' value='{$user_object->ID}' />";
} else {
$role_name = isset( $wp_roles->role_names[$role] ) ? translate_user_role( $wp_roles->role_names[$role] ) : __( 'None' );
$avatar = get_avatar( $user_object->ID, 32 );
- $r = "<tr id='user-$user_object->ID'$style>";
+ $r = "<tr id='user-$user_object->ID'>";
list( $columns, $hidden ) = $this->get_column_info();