- Timestamp:
- 09/19/2022 09:06:08 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-users-list-table.php
r54070 r54215 186 186 } 187 187 188 $role_links = array(); 189 $avail_roles = array(); 190 $all_text = __( 'All' ); 191 $current_link_attributes = empty( $role ) ? ' class="current" aria-current="page"' : ''; 188 $role_links = array(); 189 $avail_roles = array(); 190 $all_text = __( 'All' ); 192 191 193 192 if ( $count_users ) { … … 216 215 } 217 216 218 $role_links['all'] = sprintf( '<a href="%s"%s>%s</a>', $url, $current_link_attributes, $all_text ); 217 $role_links['all'] = array( 218 'url' => $url, 219 'label' => $all_text, 220 'current' => empty( $role ), 221 ); 219 222 220 223 foreach ( $wp_roles->get_names() as $this_role => $name ) { 221 224 if ( $count_users && ! isset( $avail_roles[ $this_role ] ) ) { 222 225 continue; 223 }224 225 $current_link_attributes = '';226 227 if ( $this_role === $role ) {228 $current_link_attributes = ' class="current" aria-current="page"';229 226 } 230 227 … … 239 236 } 240 237 241 $role_links[ $this_role ] = "<a href='" . esc_url( add_query_arg( 'role', $this_role, $url ) ) . "'$current_link_attributes>$name</a>"; 238 $role_links[ $this_role ] = array( 239 'url' => esc_url( add_query_arg( 'role', $this_role, $url ) ), 240 'label' => $name, 241 'current' => $this_role === $role, 242 ); 242 243 } 243 244 244 245 if ( ! empty( $avail_roles['none'] ) ) { 245 246 $current_link_attributes = '';247 248 if ( 'none' === $role ) {249 $current_link_attributes = ' class="current" aria-current="page"';250 }251 246 252 247 $name = __( 'No role' ); … … 258 253 ); 259 254 260 $role_links['none'] = "<a href='" . esc_url( add_query_arg( 'role', 'none', $url ) ) . "'$current_link_attributes>$name</a>"; 261 } 262 263 return $role_links; 255 $role_links['none'] = array( 256 'url' => esc_url( add_query_arg( 'role', 'none', $url ) ), 257 'label' => $name, 258 'current' => 'none' === $role, 259 ); 260 } 261 262 return $this->get_views_links( $role_links ); 264 263 } 265 264
Note: See TracChangeset
for help on using the changeset viewer.