Changeset 41683
- Timestamp:
- 10/02/2017 07:43:02 PM (7 years ago)
- Location:
- trunk/src/wp-admin
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-comments-list-table.php
r41168 r41683 247 247 248 248 foreach ( $stati as $status => $label ) { 249 $class = ( $status === $comment_status ) ? ' class="current"' : ''; 249 $current_link_attributes = ''; 250 251 if ( $status === $comment_status ) { 252 $current_link_attributes = ' class="current" aria-current="page"'; 253 } 250 254 251 255 if ( !isset( $num_comments->$status ) ) … … 259 263 $link = add_query_arg( 's', esc_attr( wp_unslash( $_REQUEST['s'] ) ), $link ); 260 264 */ 261 $status_links[ $status ] = "<a href='$link'$c lass>" . sprintf(265 $status_links[ $status ] = "<a href='$link'$current_link_attributes>" . sprintf( 262 266 translate_nooped_plural( $label, $num_comments->$status ), 263 267 sprintf( '<span class="%s-count">%s</span>', -
trunk/src/wp-admin/includes/class-wp-ms-themes-list-table.php
r41220 r41683 307 307 308 308 if ( 'search' != $type ) { 309 $status_links[$type] = sprintf( "<a href='%s' 309 $status_links[$type] = sprintf( "<a href='%s'%s>%s</a>", 310 310 esc_url( add_query_arg('theme_status', $type, $url) ), 311 ( $type === $status ) ? ' class="current" ' : '',311 ( $type === $status ) ? ' class="current" aria-current="page"' : '', 312 312 sprintf( $text, number_format_i18n( $count ) ) 313 313 ); -
trunk/src/wp-admin/includes/class-wp-ms-users-list-table.php
r41200 r41683 135 135 $total_admins = count( $super_admins ); 136 136 137 $c lass = $role != 'super' ? ' class="current"' : '';137 $current_link_attributes = $role !== 'super' ? ' class="current" aria-current="page"' : ''; 138 138 $role_links = array(); 139 $role_links['all'] = "<a href='" . network_admin_url( 'users.php') . "'$class>" . sprintf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_users, 'users' ), number_format_i18n( $total_users ) ) . '</a>';140 $c lass = $role === 'super' ? ' class="current"' : '';141 $role_links['super'] = "<a href='" . network_admin_url( 'users.php?role=super') . "'$class>" . sprintf( _n( 'Super Admin <span class="count">(%s)</span>', 'Super Admins <span class="count">(%s)</span>', $total_admins ), number_format_i18n( $total_admins ) ) . '</a>';139 $role_links['all'] = "<a href='" . network_admin_url( 'users.php' ) . "'$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>'; 140 $current_link_attributes = $role === 'super' ? ' class="current" aria-current="page"' : ''; 141 $role_links['super'] = "<a href='" . network_admin_url( 'users.php?role=super' ) . "'$current_link_attributes>" . sprintf( _n( 'Super Admin <span class="count">(%s)</span>', 'Super Admins <span class="count">(%s)</span>', $total_admins ), number_format_i18n( $total_admins ) ) . '</a>'; 142 142 143 143 return $role_links; -
trunk/src/wp-admin/includes/class-wp-plugin-install-list-table.php
r41612 r41683 287 287 $display_tabs = array(); 288 288 foreach ( (array) $tabs as $action => $text ) { 289 $c lass = ( $action === $tab ) ? ' current' : '';289 $current_link_attributes = ( $action === $tab ) ? ' class="current" aria-current="page"' : ''; 290 290 $href = self_admin_url('plugin-install.php?tab=' . $action); 291 $display_tabs['plugin-install-'.$action] = "<a href='$href' class='$class'>$text</a>";291 $display_tabs['plugin-install-'.$action] = "<a href='$href'$current_link_attributes>$text</a>"; 292 292 } 293 293 // No longer a real tab. -
trunk/src/wp-admin/includes/class-wp-plugins-list-table.php
r41399 r41683 433 433 434 434 if ( 'search' !== $type ) { 435 $status_links[$type] = sprintf( "<a href='%s' 435 $status_links[$type] = sprintf( "<a href='%s'%s>%s</a>", 436 436 add_query_arg('plugin_status', $type, 'plugins.php'), 437 ( $type === $status ) ? ' class="current" ' : '',437 ( $type === $status ) ? ' class="current" aria-current="page"' : '', 438 438 sprintf( $text, number_format_i18n( $count ) ) 439 439 ); -
trunk/src/wp-admin/includes/class-wp-posts-list-table.php
r41576 r41683 232 232 $url = add_query_arg( $args, 'edit.php' ); 233 233 234 $class_html = '';234 $class_html = $aria_current = ''; 235 235 if ( ! empty( $class ) ) { 236 236 $class_html = sprintf( … … 238 238 esc_attr( $class ) 239 239 ); 240 241 if ( 'current' === $class ) { 242 $aria_current = ' aria-current="page"'; 243 } 240 244 } 241 245 242 246 return sprintf( 243 '<a href="%s"%s >%s</a>',247 '<a href="%s"%s%s>%s</a>', 244 248 esc_url( $url ), 245 249 $class_html, 250 $aria_current, 246 251 $label 247 252 ); -
trunk/src/wp-admin/includes/class-wp-theme-install-list-table.php
r41161 r41683 171 171 $display_tabs = array(); 172 172 foreach ( (array) $tabs as $action => $text ) { 173 $c lass = ( $action === $tab ) ? ' class="current"' : '';173 $current_link_attributes = ( $action === $tab ) ? ' class="current" aria-current="page"' : ''; 174 174 $href = self_admin_url('theme-install.php?tab=' . $action); 175 $display_tabs['theme-install-'.$action] = "<a href='$href'$c lass>$text</a>";175 $display_tabs['theme-install-'.$action] = "<a href='$href'$current_link_attributes>$text</a>"; 176 176 } 177 177 -
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 } -
trunk/src/wp-admin/js/theme.js
r41658 r41683 1540 1540 } 1541 1541 1542 $( '.filter-links li > a.current' ).removeClass( 'current' ); 1542 $( '.filter-links li > a.current' ) 1543 .removeClass( 'current' ) 1544 .removeAttr( 'aria-current' ); 1545 1543 1546 $( 'body' ).removeClass( 'show-filters filters-applied show-favorites-form' ); 1544 1547 $( '.drawer-toggle' ).attr( 'aria-expanded', 'false' ); … … 1664 1667 themes.router.selectedTab = sort; 1665 1668 1666 $( '.filter-links li > a, .theme-filter' ).removeClass( this.activeClass ); 1667 $( '[data-sort="' + sort + '"]' ).addClass( this.activeClass ); 1669 $( '.filter-links li > a, .theme-filter' ) 1670 .removeClass( this.activeClass ) 1671 .removeAttr( 'aria-current' ); 1672 1673 $( '[data-sort="' + sort + '"]' ) 1674 .addClass( this.activeClass ) 1675 .attr( 'aria-current', 'page' ); 1668 1676 1669 1677 if ( 'favorites' === sort ) { … … 1687 1695 } 1688 1696 1689 $( '.filter-links li > a, .theme-section' ).removeClass( this.activeClass ); 1690 $el.addClass( this.activeClass ); 1697 $( '.filter-links li > a, .theme-section' ) 1698 .removeClass( this.activeClass ) 1699 .removeAttr( 'aria-current' ); 1700 $el 1701 .addClass( this.activeClass ) 1702 .attr( 'aria-current', 'page' ); 1691 1703 1692 1704 if ( ! filter ) { … … 1726 1738 1727 1739 $( 'body' ).addClass( 'filters-applied' ); 1728 $( '.filter-links li > a.current' ).removeClass( 'current' ); 1740 $( '.filter-links li > a.current' ) 1741 .removeClass( 'current' ) 1742 .removeAttr( 'aria-current' ); 1743 1729 1744 filteringBy.empty(); 1730 1745
Note: See TracChangeset
for help on using the changeset viewer.