Make WordPress Core

Ticket #26562: 26562.2.patch

File 26562.2.patch, 2.7 KB (added by sabernhardt, 5 years ago)

replaces counts by type with total count; adds aria-hidden to ab-icon elements

  • src/wp-includes/admin-bar.php

     
    131131
    132132        $wp_logo_menu_args = array(
    133133                'id'    => 'wp-logo',
    134                 'title' => '<span class="ab-icon"></span><span class="screen-reader-text">' . __( 'About WordPress' ) . '</span>',
     134                'title' => '<span class="ab-icon" aria-hidden="true"></span><span class="screen-reader-text">' . __( 'About WordPress' ) . '</span>',
    135135                'href'  => $about_url,
    136136        );
    137137
     
    209209                $wp_admin_bar->add_node(
    210210                        array(
    211211                                'id'    => 'menu-toggle',
    212                                 'title' => '<span class="ab-icon"></span><span class="screen-reader-text">' . __( 'Menu' ) . '</span>',
     212                                'title' => '<span class="ab-icon" aria-hidden="true"></span><span class="screen-reader-text">' . __( 'Menu' ) . '</span>',
    213213                                'href'  => '#',
    214214                        )
    215215                );
     
    878878                return;
    879879        }
    880880
    881         $title = '<span class="ab-icon"></span><span class="ab-label">' . _x( 'New', 'admin bar menu group label' ) . '</span>';
     881        $title = '<span class="ab-icon" aria-hidden="true"></span><span class="ab-label">' . _x( 'New', 'admin bar menu group label' ) . '</span>';
    882882
    883883        $wp_admin_bar->add_node(
    884884                array(
     
    922922                number_format_i18n( $awaiting_mod )
    923923        );
    924924
    925         $icon   = '<span class="ab-icon"></span>';
     925        $icon   = '<span class="ab-icon" aria-hidden="true"></span>';
    926926        $title  = '<span class="ab-label awaiting-mod pending-count count-' . $awaiting_mod . '" aria-hidden="true">' . number_format_i18n( $awaiting_mod ) . '</span>';
    927927        $title .= '<span class="screen-reader-text comments-in-moderation-text">' . $awaiting_text . '</span>';
    928928
     
    10321032                return;
    10331033        }
    10341034
    1035         $title  = '<span class="ab-icon"></span><span class="ab-label">' . number_format_i18n( $update_data['counts']['total'] ) . '</span>';
    1036         $title .= '<span class="screen-reader-text">' . $update_data['title'] . '</span>';
     1035        $updates_text = sprintf(
     1036                /* translators: %s: Total number of updates available. */
     1037                _n( '%s update available', '%s updates available', $update_data['counts']['total'] ),
     1038                number_format_i18n( $update_data['counts']['total'] )
     1039        );
    10371040
     1041        $icon   = '<span class="ab-icon" aria-hidden="true"></span>';
     1042        $title  = '<span class="ab-label" aria-hidden="true">' . number_format_i18n( $update_data['counts']['total'] ) . '</span>';
     1043        $title .= '<span class="screen-reader-text updates-available-text">' . $updates_text . '</span>';
     1044
    10381045        $wp_admin_bar->add_node(
    10391046                array(
    10401047                        'id'    => 'updates',
    1041                         'title' => $title,
     1048                        'title' => $icon . $title,
    10421049                        'href'  => network_admin_url( 'update-core.php' ),
    1043                         'meta'  => array(
    1044                                 'title' => $update_data['title'],
    1045                         ),
    10461050                )
    10471051        );
    10481052}