Ticket #32399: 32399.diff
File 32399.diff, 11.7 KB (added by , 7 years ago) |
---|
-
src/wp-admin/includes/class-wp-comments-list-table.php
246 246 $link = add_query_arg( 'comment_type', $comment_type, $link ); 247 247 248 248 foreach ( $stati as $status => $label ) { 249 $class = ( $status === $comment_status ) ? ' class="current"' :'';249 $class = $aria_current = ''; 250 250 251 if ( $status === $comment_status ) { 252 $class = ' class="current"'; 253 $aria_current = ' aria-current="page"'; 254 } 255 251 256 if ( !isset( $num_comments->$status ) ) 252 257 $num_comments->$status = 10; 253 258 $link = add_query_arg( 'comment_status', $status, $link ); … … 258 263 if ( !empty( $_REQUEST['s'] ) ) 259 264 $link = add_query_arg( 's', esc_attr( wp_unslash( $_REQUEST['s'] ) ), $link ); 260 265 */ 261 $status_links[ $status ] = "<a href='$link'$class >" . sprintf(266 $status_links[ $status ] = "<a href='$link'$class$aria_current>" . sprintf( 262 267 translate_nooped_plural( $label, $num_comments->$status ), 263 268 sprintf( '<span class="%s-count">%s</span>', 264 269 ( 'moderated' === $status ) ? 'pending' : $status, -
src/wp-admin/includes/class-wp-ms-themes-list-table.php
306 306 $url = 'themes.php'; 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>%s</a>", 310 310 esc_url( add_query_arg('theme_status', $type, $url) ), 311 311 ( $type === $status ) ? ' class="current"' : '', 312 ( $type === $status ) ? ' aria-current="page"' : '', 312 313 sprintf( $text, number_format_i18n( $count ) ) 313 314 ); 314 315 } -
src/wp-admin/includes/class-wp-ms-users-list-table.php
135 135 $total_admins = count( $super_admins ); 136 136 137 137 $class = $role != 'super' ? ' class="current"' : ''; 138 $aria_current = $role != 'super' ? ' aria-current="page"' : ''; 138 139 $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 $role_links['all'] = "<a href='" . network_admin_url('users.php') . "'$class$aria_current>" . sprintf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_users, 'users' ), number_format_i18n( $total_users ) ) . '</a>'; 140 141 $class = $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>'; 142 $aria_current = $role === 'super' ? ' aria-current="page"' : ''; 143 $role_links['super'] = "<a href='" . network_admin_url('users.php?role=super') . "'$class$aria_current>" . 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 144 143 145 return $role_links; 144 146 } -
src/wp-admin/includes/class-wp-plugin-install-list-table.php
286 286 287 287 $display_tabs = array(); 288 288 foreach ( (array) $tabs as $action => $text ) { 289 $class = ( $action === $tab ) ? ' current' : ''; 289 $class = ( $action === $tab ) ? ' class="current"' : ''; 290 $aria_current = ( $action === $tab ) ? ' aria-current="page"' : ''; 290 291 $href = self_admin_url('plugin-install.php?tab=' . $action); 291 $display_tabs['plugin-install-'.$action] = "<a href='$href' class='$class'>$text</a>";292 $display_tabs['plugin-install-'.$action] = "<a href='$href'$class$aria_current>$text</a>"; 292 293 } 293 294 // No longer a real tab. 294 295 unset( $display_tabs['plugin-install-upload'] ); -
src/wp-admin/includes/class-wp-plugins-list-table.php
432 432 } 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>%s</a>", 436 436 add_query_arg('plugin_status', $type, 'plugins.php'), 437 437 ( $type === $status ) ? ' class="current"' : '', 438 ( $type === $status ) ? ' aria-current="page"' : '', 438 439 sprintf( $text, number_format_i18n( $count ) ) 439 440 ); 440 441 } -
src/wp-admin/includes/class-wp-posts-list-table.php
231 231 protected function get_edit_link( $args, $label, $class = '' ) { 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( 237 237 ' class="%s"', 238 238 esc_attr( $class ) 239 239 ); 240 $aria_current = ' aria-current="page"'; 240 241 } 241 242 242 243 return sprintf( 243 '<a href="%s"%s >%s</a>',244 '<a href="%s"%s%s>%s</a>', 244 245 esc_url( $url ), 245 246 $class_html, 247 $aria_current, 246 248 $label 247 249 ); 248 250 } -
src/wp-admin/includes/class-wp-theme-install-list-table.php
171 171 $display_tabs = array(); 172 172 foreach ( (array) $tabs as $action => $text ) { 173 173 $class = ( $action === $tab ) ? ' class="current"' : ''; 174 $aria_current = ( $action === $tab ) ? ' aria-current="page"' : ''; 174 175 $href = self_admin_url('theme-install.php?tab=' . $action); 175 $display_tabs['theme-install-'.$action] = "<a href='$href'$class >$text</a>";176 $display_tabs['theme-install-'.$action] = "<a href='$href'$class$aria_current>$text</a>"; 176 177 } 177 178 178 179 return $display_tabs; -
src/wp-admin/includes/class-wp-users-list-table.php
196 196 $avail_roles = array(); 197 197 } 198 198 199 $class = empty($role) ? ' class="current"' : ''; 199 $class = $aria_current = ''; 200 201 if ( empty( $role) ) { 202 $class = ' class="current"'; 203 $aria_current = ' aria-current="page"'; 204 } 205 200 206 $role_links = array(); 201 207 202 208 if ( $count_users ) { 203 $role_links['all'] = "<a href='$url'$class >" . sprintf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_users, 'users' ), number_format_i18n( $total_users ) ) . '</a>';209 $role_links['all'] = "<a href='$url'$class$aria_current>" . sprintf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_users, 'users' ), number_format_i18n( $total_users ) ) . '</a>'; 204 210 } else { 205 $role_links['all'] = "<a href='$url'$class >" . _x( 'All', 'users' ) . '</a>';211 $role_links['all'] = "<a href='$url'$class$aria_current>" . _x( 'All', 'users' ) . '</a>'; 206 212 } 207 213 foreach ( $wp_roles->get_names() as $this_role => $name ) { 208 214 if ( $count_users && !isset($avail_roles[$this_role]) ) { … … 209 215 continue; 210 216 } 211 217 212 $class = '';218 $class = $aria_current = ''; 213 219 214 220 if ( $this_role === $role ) { 215 221 $class = ' class="current"'; 222 $aria_current = ' aria-current="page"'; 216 223 } 217 224 218 225 $name = translate_user_role( $name ); … … 220 227 /* translators: User role name with count */ 221 228 $name = sprintf( __('%1$s <span class="count">(%2$s)</span>'), $name, number_format_i18n( $avail_roles[$this_role] ) ); 222 229 } 223 $role_links[$this_role] = "<a href='" . esc_url( add_query_arg( 'role', $this_role, $url ) ) . "'$class >$name</a>";230 $role_links[$this_role] = "<a href='" . esc_url( add_query_arg( 'role', $this_role, $url ) ) . "'$class$aria_current>$name</a>"; 224 231 } 225 232 226 233 if ( ! $count_users || ! empty( $avail_roles['none' ] ) ) { 227 234 228 $class = '';235 $class = $aria_current = ''; 229 236 230 237 if ( 'none' === $role ) { 231 238 $class = ' class="current"'; 239 $aria_current = ' aria-current="page"'; 232 240 } 233 241 234 242 $name = __( 'No role' ); -
src/wp-admin/js/theme.js
1539 1539 request.tag = [ value.slice( 4 ) ]; 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' ); 1545 1548 … … 1603 1606 this.listenTo( this.collection, 'query:fail', function() { 1604 1607 $( 'body' ).removeClass( 'loading-content' ); 1605 1608 $( '.theme-browser' ).find( 'div.error' ).remove(); 1606 $( '.theme-browser' ).find( 'div.themes' ).before( '<div class="error"><p>' + l10n.error + '</p><p><button class="button try-again">' + l10n.tryAgain + '</button></p></div>' ); 1607 $( '.theme-browser .error .try-again' ).on( 'click', function( e ) { 1608 e.preventDefault(); 1609 $( 'input.wp-filter-search' ).trigger( 'input' ); 1609 $( '.theme-browser' ).find( 'div.themes' ).before( '<div class="error"><p>' + l10n.error + '</p><p><button class="button try-again">' + l10n.tryAgain + '</button></p></div>' ); 1610 $( '.theme-browser .error .try-again' ).on( 'click', function( e ) { 1611 e.preventDefault(); 1612 $( 'input.wp-filter-search' ).trigger( 'input' ); 1610 1613 } ); 1611 1614 }); 1612 1615 … … 1663 1666 // Track sorting so we can restore the correct tab when closing preview. 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' ); 1668 1672 1673 $( '[data-sort="' + sort + '"]' ) 1674 .addClass( this.activeClass ) 1675 .attr( 'aria-current', 'page' ); 1676 1669 1677 if ( 'favorites' === sort ) { 1670 1678 $( 'body' ).addClass( 'show-favorites-form' ); 1671 1679 } else { … … 1686 1694 return; 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 ) { 1693 1705 return; … … 1725 1737 } 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 1731 1746 _.each( tags, function( tag ) {