WordPress.org

Make WordPress Core

Ticket #32147: 32147.4.patch

File 32147.4.patch, 17.9 KB (added by afercia, 4 years ago)
  • src/wp-admin/css/list-tables.css

     
    532532}
    533533
    534534.tablenav .no-pages,
    535 .tablenav .one-page .pagination-links {
     535.tablenav .one-page .pagination-links,
     536.tablenav .one-page .pagination-heading {
    536537        display: none;
    537538}
    538539
  • src/wp-admin/edit-comments.php

     
    136136        '<p>' . __( '<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>'
    137137);
    138138
     139get_current_screen()->add_a11y_info( array(
     140        'heading_views'      => __( 'Filter comments list' ),
     141        'heading_pagination' => __( 'Comments list navigation' ),
     142        'heading_list'       => __( 'Comments list' ),
     143) );
     144
    139145require_once( ABSPATH . 'wp-admin/admin-header.php' );
    140146?>
    141147
  • src/wp-admin/edit-tags.php

     
    4545
    4646add_screen_option( 'per_page', array( 'default' => 20, 'option' => 'edit_' . $tax->name . '_per_page' ) );
    4747
     48get_current_screen()->add_a11y_info( array(
     49        'heading_pagination' => $tax->labels->pagination,
     50        'heading_list'       => $tax->labels->list,
     51) );
     52
    4853$location = false;
    4954
    5055switch ( $wp_list_table->current_action() ) {
  • src/wp-admin/edit.php

     
    236236        '<p>' . __('<a href="https://codex.wordpress.org/Pages_Screen" target="_blank">Documentation on Managing Pages</a>') . '</p>' .
    237237        '<p>' . __('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
    238238        );
     239
    239240}
    240241
     242get_current_screen()->add_a11y_info( array(
     243        'heading_views'      => $post_type_object->labels->views,
     244        'heading_pagination' => $post_type_object->labels->pagination,
     245        'heading_list'       => $post_type_object->labels->list,
     246) );
     247
    241248add_screen_option( 'per_page', array( 'default' => 20, 'option' => 'edit_' . $post_type . '_per_page' ) );
    242249
    243250$bulk_counts = array(
  • src/wp-admin/includes/class-wp-comments-list-table.php

     
    374374
    375375                $this->display_tablenav( 'top' );
    376376
     377                if ( isset( $this->screen->a11y_info['heading_list'] ) ) {
     378                        $heading = '<h2 class="screen-reader-text list-heading">' . $this->screen->a11y_info['heading_list'] . '</h2>';
     379                } else {
     380                        $heading = '';
     381                }
     382
     383                echo $heading;
    377384?>
    378385<table class="<?php echo implode( ' ', $this->get_table_classes() ); ?>">
    379386        <thead>
     
    441448         */
    442449        protected function handle_row_actions( $comment, $column_name, $primary ) {
    443450                global $comment_status;
    444  
     451
    445452                if ( ! $this->user_can ) {
    446453                        return;
    447454
  • src/wp-admin/includes/class-wp-list-table.php

     
    378378                if ( empty( $views ) )
    379379                        return;
    380380
    381                 echo "<ul class='subsubsub'>\n";
     381                if ( isset( $this->screen->a11y_info['heading_views'] ) ) {
     382                        $heading = '<h2 class="screen-reader-text views-heading">' . $this->screen->a11y_info['heading_views'] . '</h2>';
     383                } else {
     384                        $heading = '';
     385                }
     386
     387                echo "$heading\n<ul class='subsubsub'>\n";
    382388                foreach ( $views as $class => $view ) {
    383389                        $views[ $class ] = "\t<li class='$class'>$view";
    384390                }
     
    689695                        $infinite_scroll = $this->_pagination_args['infinite_scroll'];
    690696                }
    691697
    692                 $output = '<span class="displaying-num">' . sprintf( _n( '%s item', '%s items', $total_items ), number_format_i18n( $total_items ) ) . '</span>';
     698                if ( 'top' === $which && isset( $this->screen->a11y_info['heading_pagination'] ) ) {
     699                        $heading = '<h2 class="screen-reader-text pagination-heading">' . $this->screen->a11y_info['heading_pagination'] . '</h2>';
     700                } else {
     701                        $heading = '';
     702                }
    693703
     704                $output = $heading . '<span class="displaying-num">' . sprintf( _n( '%s item', '%s items', $total_items ), number_format_i18n( $total_items ) ) . '</span>';
     705
    694706                $current = $this->get_pagenum();
    695707
    696708                $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
     
    975987
    976988                $this->display_tablenav( 'top' );
    977989
     990                if ( isset( $this->screen->a11y_info['heading_list'] ) ) {
     991                        $heading = '<h2 class="screen-reader-text list-heading">' . $this->screen->a11y_info['heading_list'] . '</h2>';
     992                } else {
     993                        $heading = '';
     994                }
     995
     996                echo $heading;
     997
    978998?>
    979999<table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>">
    9801000        <thead>
  • src/wp-admin/includes/class-wp-media-list-table.php

     
    181181                global $mode;
    182182
    183183                $views = $this->get_views();
     184
     185                if ( isset( $this->screen->a11y_info['heading_views'] ) ) {
     186                        echo '<h2 class="screen-reader-text filter-views-heading">' . $this->screen->a11y_info['heading_views'] . '</h2>';
     187                }
    184188?>
    185189<div class="wp-filter">
    186190        <div class="filter-items">
  • src/wp-admin/includes/class-wp-plugin-install-list-table.php

     
    247247                /** This filter is documented in wp-admin/inclues/class-wp-list-table.php */
    248248                $views = apply_filters( "views_{$this->screen->id}", $views );
    249249
     250                if ( isset( $this->screen->a11y_info['heading_views'] ) ) {
     251                        echo '<h2 class="screen-reader-text filter-views-heading">' . $this->screen->a11y_info['heading_views'] . '</h2>';
     252                }
     253
    250254?>
    251255<div class="wp-filter">
    252256        <ul class="filter-links">
     
    281285
    282286?>
    283287<div class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>">
    284 
     288<?php
     289if ( isset( $this->screen->a11y_info['heading_list'] ) ) {
     290        echo '<h2 class="screen-reader-text list-heading">' . $this->screen->a11y_info['heading_list'] . '</h2>';
     291}
     292?>
    285293        <div id="the-list"<?php echo $data_attr; ?>>
    286294                <?php $this->display_rows_or_placeholder(); ?>
    287295        </div>
  • src/wp-admin/includes/screen.php

     
    326326        private $_help_sidebar = '';
    327327
    328328        /**
     329         * The accessibility information associated with the screen, if any.
     330         *
     331         * @since 4.3.0
     332         * @var array
     333         * @access public
     334         */
     335        public $a11y_info = array();
     336
     337        /**
    329338         * Stores old string-based help.
    330339         */
    331340        private static $_old_compat_help = array();
     
    791800                return $this->columns;
    792801        }
    793802
     803        /**
     804         * Add accessibility related informations.
     805         *
     806         * @since 4.3.0
     807         *
     808         * @param array $args An associative array with additional information useful for accessibility.
     809         * - string - heading_views      - The table views hidden heading text.
     810         * - string - heading_pagination - The table pagination hidden heading text.
     811         * - string - heading_list       - The table hidden heading text.
     812         */
     813        public function add_a11y_info( $args = array() ) {
     814                $defaults = array(
     815                        'heading_views'      => __( 'Filter items list' ),
     816                        'heading_pagination' => __( 'Items list navigation' ),
     817                        'heading_list'       => __( 'Items list' ),
     818                );
     819                $args = wp_parse_args( $args, $defaults );
     820
     821                $this->a11y_info = $args;
     822        }
     823
    794824        /**
    795825         * Render the screen's help section.
    796826         *
  • src/wp-admin/link-manager.php

     
    6161        '<p>' . __('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
    6262);
    6363
     64get_current_screen()->add_a11y_info( array(
     65        'heading_list' => __( 'Links list' ),
     66) );
     67
    6468include_once( ABSPATH . 'wp-admin/admin-header.php' );
    6569
    6670if ( ! current_user_can('manage_links') )
  • src/wp-admin/network/site-themes.php

     
    3333        '<p>' . __('<a href="https://wordpress.org/support/forum/multisite/" target="_blank">Support Forums</a>') . '</p>'
    3434);
    3535
     36get_current_screen()->add_a11y_info( array(
     37        'heading_views'      => __( 'Filter site themes list' ),
     38        'heading_pagination' => __( 'Site themes list navigation' ),
     39        'heading_list'       => __( 'Site themes list' ),
     40) );
     41
    3642$wp_list_table = _get_list_table('WP_MS_Themes_List_Table');
    3743
    3844$action = $wp_list_table->current_action();
  • src/wp-admin/network/site-users.php

     
    3636        '<p>' . __('<a href="https://wordpress.org/support/forum/multisite/" target="_blank">Support Forums</a>') . '</p>'
    3737);
    3838
     39get_current_screen()->add_a11y_info( array(
     40        'heading_views'      => __( 'Filter site users list' ),
     41        'heading_pagination' => __( 'Site users list navigation' ),
     42        'heading_list'       => __( 'Site users list' ),
     43) );
     44
    3945$_SERVER['REQUEST_URI'] = remove_query_arg( 'update', $_SERVER['REQUEST_URI'] );
    4046$referer = remove_query_arg( 'update', wp_get_referer() );
    4147
  • src/wp-admin/network/sites.php

     
    4646        '<p>' . __('<a href="https://wordpress.org/support/forum/multisite/" target="_blank">Support Forums</a>') . '</p>'
    4747);
    4848
     49get_current_screen()->add_a11y_info( array(
     50        'heading_pagination' => __( 'Sites list navigation' ),
     51        'heading_list'       => __( 'Sites list' ),
     52) );
     53
    4954$id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0;
    5055
    5156if ( isset( $_GET['action'] ) ) {
  • src/wp-admin/network/themes.php

     
    251251        '<p>' . __('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
    252252);
    253253
     254get_current_screen()->add_a11y_info( array(
     255        'heading_views'      => __( 'Filter themes list' ),
     256        'heading_pagination' => __( 'Themes list navigation' ),
     257        'heading_list'       => __( 'Themes list' ),
     258) );
     259
    254260$title = __('Themes');
    255261$parent_file = 'themes.php';
    256262
  • src/wp-admin/network/users.php

     
    276276        '<p>' . __('<a href="https://wordpress.org/support/forum/multisite/" target="_blank">Support Forums</a>') . '</p>'
    277277);
    278278
     279get_current_screen()->add_a11y_info( array(
     280        'heading_views'      => __( 'Filter users list' ),
     281        'heading_pagination' => __( 'Users list navigation' ),
     282        'heading_list'       => __( 'Users list' ),
     283) );
     284
    279285require_once( ABSPATH . 'wp-admin/admin-header.php' );
    280286
    281287if ( isset( $_REQUEST['updated'] ) && $_REQUEST['updated'] == 'true' && ! empty( $_REQUEST['action'] ) ) {
  • src/wp-admin/plugin-install.php

     
    8888        '<p>' . __('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
    8989);
    9090
     91get_current_screen()->add_a11y_info( array(
     92        'heading_views'      => __( 'Filter plugins list' ),
     93        'heading_pagination' => __( 'Plugins list navigation' ),
     94        'heading_list'       => __( 'Plugins list' ),
     95) );
     96
    9197/**
    9298 * WordPress Administration Template Header.
    9399 */
  • src/wp-admin/plugins.php

     
    392392        '<p>' . __('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
    393393);
    394394
     395get_current_screen()->add_a11y_info( array(
     396        'heading_views'      => __( 'Filter plugins list' ),
     397        'heading_pagination' => __( 'Plugins list navigation' ),
     398        'heading_list'       => __( 'Plugins list' ),
     399) );
     400
    395401$title = __('Plugins');
    396402$parent_file = 'plugins.php';
    397403
  • src/wp-admin/theme-install.php

     
    126126        <?php install_themes_upload(); ?>
    127127        </div>
    128128
     129        <h2 class="screen-reader-text"><?php _e( 'Filter themes list' ); ?></h2>
     130
    129131        <div class="wp-filter">
    130132                <div class="filter-count">
    131133                        <span class="count theme-count"></span>
     
    169171                        </div>
    170172                </div>
    171173        </div>
     174        <h2 class="screen-reader-text"><?php _e( 'Themes list' ); ?></h2>
    172175        <div class="theme-browser content-filterable"></div>
    173176        <div class="theme-install-overlay wp-full-overlay expanded"></div>
    174177
  • src/wp-admin/upload.php

     
    202202        '<p>' . __( '<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>'
    203203);
    204204
     205get_current_screen()->add_a11y_info( array(
     206        'heading_views'      => __( 'Filter media items list' ),
     207        'heading_pagination' => __( 'Media items list navigation' ),
     208        'heading_list'       => __( 'Media items list' ),
     209) );
     210
    205211require_once( ABSPATH . 'wp-admin/admin-header.php' );
    206212?>
    207213
  • src/wp-admin/users.php

     
    6363    '<p>' . __('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
    6464);
    6565
     66get_current_screen()->add_a11y_info( array(
     67        'heading_views'      => __( 'Filter users list' ),
     68        'heading_pagination' => __( 'Users list navigation' ),
     69        'heading_list'       => __( 'Users list' ),
     70) );
     71
    6672if ( empty($_REQUEST) ) {
    6773        $referer = '<input type="hidden" name="wp_http_referer" value="'. esc_attr( wp_unslash( $_SERVER['REQUEST_URI'] ) ) . '" />';
    6874} elseif ( isset($_REQUEST['wp_http_referer']) ) {
  • src/wp-includes/post.php

     
    16251625 *                       ones the default is 'Parent Page:'.
    16261626 * - all_items - String for the submenu. Default is All Posts/All Pages.
    16271627 * - menu_name - Default is the same as `name`.
     1628 * - views - String for the table views hidden heading.
     1629 * - pagination - String for the table pagination hidden heading.
     1630 * - list - String for the table hidden heading.
    16281631 *
    16291632 * Above, the first default value is for non-hierarchical post types (like posts)
    16301633 * and the second one is for hierarchical post types (like pages).
     
    16481651                'not_found' => array( __('No posts found.'), __('No pages found.') ),
    16491652                'not_found_in_trash' => array( __('No posts found in Trash.'), __('No pages found in Trash.') ),
    16501653                'parent_item_colon' => array( null, __('Parent Page:') ),
    1651                 'all_items' => array( __( 'All Posts' ), __( 'All Pages' ) )
     1654                'all_items' => array( __( 'All Posts' ), __( 'All Pages' ) ),
     1655                'views' => array( __( 'Filter posts list' ), __( 'Filter pages list' ) ),
     1656                'pagination' => array( __( 'Posts list navigation' ), __( 'Pages list navigation' ) ),
     1657                'list' => array( __( 'Posts list' ), __( 'Pages list' ) ),
    16521658        );
    16531659        $nohier_vs_hier_defaults['menu_name'] = $nohier_vs_hier_defaults['name'];
    16541660
  • src/wp-includes/taxonomy.php

     
    472472 * - add_or_remove_items - This string isn't used on hierarchical taxonomies. Default is "Add or remove tags", used in the meta box when JavaScript is disabled.
    473473 * - choose_from_most_used - This string isn't used on hierarchical taxonomies. Default is "Choose from the most used tags", used in the meta box.
    474474 * - not_found - Default is "No tags found"/"No categories found", used in the meta box and taxonomy list table.
     475 * - pagination - String for the table pagination hidden heading.
     476 * - list - String for the table hidden heading.
    475477 *
    476478 * Above, the first default value is for non-hierarchical taxonomies (like tags) and the second one is for hierarchical taxonomies (like categories).
    477479 *
     
    508510                'add_or_remove_items' => array( __( 'Add or remove tags' ), null ),
    509511                'choose_from_most_used' => array( __( 'Choose from the most used tags' ), null ),
    510512                'not_found' => array( __( 'No tags found.' ), __( 'No categories found.' ) ),
     513                'pagination' => array( __( 'Tags list navigation' ), __( 'Categories list navigation' ) ),
     514                'list' => array( __( 'Tags list' ), __( 'Categories list' ) ),
    511515        );
    512516        $nohier_vs_hier_defaults['menu_name'] = $nohier_vs_hier_defaults['name'];
    513517