- Timestamp:
- 10/02/2017 07:43:02 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-users-list-table.php
r41613 r41683 197 197 } 198 198 199 $class = empty($role) ? ' class="current"' : ''; 199 $current_link_attributes = empty( $role ) ? ' class="current" aria-current="page"' : ''; 200 200 201 $role_links = array(); 201 202 202 203 if ( $count_users ) { 203 $role_links['all'] = "<a href='$url'$c lass>" . sprintf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_users, 'users' ), number_format_i18n( $total_users ) ) . '</a>';204 $role_links['all'] = "<a href='$url'$current_link_attributes>" . sprintf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_users, 'users' ), number_format_i18n( $total_users ) ) . '</a>'; 204 205 } else { 205 $role_links['all'] = "<a href='$url'$c lass>" . _x( 'All', 'users' ) . '</a>';206 $role_links['all'] = "<a href='$url'$current_link_attributes>" . _x( 'All', 'users' ) . '</a>'; 206 207 } 207 208 foreach ( $wp_roles->get_names() as $this_role => $name ) { … … 210 211 } 211 212 212 $c lass = '';213 $current_link_attributes = ''; 213 214 214 215 if ( $this_role === $role ) { 215 $c lass = ' class="current"';216 $current_link_attributes = ' class="current" aria-current="page"'; 216 217 } 217 218 … … 221 222 $name = sprintf( __('%1$s <span class="count">(%2$s)</span>'), $name, number_format_i18n( $avail_roles[$this_role] ) ); 222 223 } 223 $role_links[$this_role] = "<a href='" . esc_url( add_query_arg( 'role', $this_role, $url ) ) . "'$c lass>$name</a>";224 $role_links[$this_role] = "<a href='" . esc_url( add_query_arg( 'role', $this_role, $url ) ) . "'$current_link_attributes>$name</a>"; 224 225 } 225 226 226 227 if ( ! $count_users || ! empty( $avail_roles['none' ] ) ) { 227 228 228 $c lass = '';229 $current_link_attributes = ''; 229 230 230 231 if ( 'none' === $role ) { 231 $c lass = ' class="current"';232 $current_link_attributes = ' class="current" aria-current="page"'; 232 233 } 233 234 … … 237 238 $name = sprintf( __('%1$s <span class="count">(%2$s)</span>'), $name, number_format_i18n( $avail_roles['none' ] ) ); 238 239 } 239 $role_links['none'] = "<a href='" . esc_url( add_query_arg( 'role', 'none', $url ) ) . "'$c lass>$name</a>";240 $role_links['none'] = "<a href='" . esc_url( add_query_arg( 'role', 'none', $url ) ) . "'$current_link_attributes>$name</a>"; 240 241 241 242 }
Note: See TracChangeset
for help on using the changeset viewer.