WordPress.org

Make WordPress Core

Ticket #32147: 32147.7.patch

File 32147.7.patch, 18.0 KB (added by afercia, 4 years ago)
  • src/wp-admin/edit-comments.php

     
    165165        '<p>' . __( '<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>'
    166166);
    167167
     168get_current_screen()->set_screen_reader_content( array(
     169        'heading_views'      => __( 'Filter comments list' ),
     170        'heading_pagination' => __( 'Comments list navigation' ),
     171        'heading_list'       => __( 'Comments list' ),
     172) );
     173
    168174require_once( ABSPATH . 'wp-admin/admin-header.php' );
    169175?>
    170176
  • src/wp-admin/edit-tags.php

     
    5454
    5555add_screen_option( 'per_page', array( 'default' => 20, 'option' => 'edit_' . $tax->name . '_per_page' ) );
    5656
     57get_current_screen()->set_screen_reader_content( array(
     58        'heading_pagination' => $tax->labels->pagination,
     59        'heading_list'       => $tax->labels->list,
     60) );
     61
    5762$location = false;
    5863$referer = wp_get_referer();
    5964
  • src/wp-admin/edit.php

     
    245245        '<p>' . __('<a href="https://codex.wordpress.org/Pages_Screen" target="_blank">Documentation on Managing Pages</a>') . '</p>' .
    246246        '<p>' . __('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
    247247        );
     248
    248249}
    249250
     251get_current_screen()->set_screen_reader_content( array(
     252        'heading_views'      => $post_type_object->labels->views,
     253        'heading_pagination' => $post_type_object->labels->pagination,
     254        'heading_list'       => $post_type_object->labels->list,
     255) );
     256
    250257add_screen_option( 'per_page', array( 'default' => 20, 'option' => 'edit_' . $post_type . '_per_page' ) );
    251258
    252259$bulk_counts = array(
  • src/wp-admin/includes/class-wp-comments-list-table.php

     
    443443
    444444                $this->display_tablenav( 'top' );
    445445
     446                $this->screen->render_screen_reader_content( 'heading_list' );
     447
    446448?>
    447449<table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>">
    448450        <thead>
  • src/wp-admin/includes/class-wp-list-table.php

     
    382382                if ( empty( $views ) )
    383383                        return;
    384384
     385                $this->screen->render_screen_reader_content( 'heading_views' );
     386
    385387                echo "<ul class='subsubsub'>\n";
    386388                foreach ( $views as $class => $view ) {
    387389                        $views[ $class ] = "\t<li class='$class'>$view";
     
    734736                        $infinite_scroll = $this->_pagination_args['infinite_scroll'];
    735737                }
    736738
     739                if ( 'top' === $which && $total_pages > 1 ) {
     740                        $this->screen->render_screen_reader_content( 'heading_pagination' );
     741                }
     742
    737743                $output = '<span class="displaying-num">' . sprintf( _n( '%s item', '%s items', $total_items ), number_format_i18n( $total_items ) ) . '</span>';
    738744
    739745                $current = $this->get_pagenum();
     
    11171123                $singular = $this->_args['singular'];
    11181124
    11191125                $this->display_tablenav( 'top' );
     1126
     1127                $this->screen->render_screen_reader_content( 'heading_list' );
    11201128?>
    11211129<table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>">
    11221130        <thead>
  • src/wp-admin/includes/class-wp-media-list-table.php

     
    217217                global $mode;
    218218
    219219                $views = $this->get_views();
     220
     221                $this->screen->render_screen_reader_content( 'heading_views' );
    220222?>
    221223<div class="wp-filter">
    222224        <div class="filter-items">
  • src/wp-admin/includes/class-wp-plugin-install-list-table.php

     
    258258                /** This filter is documented in wp-admin/inclues/class-wp-list-table.php */
    259259                $views = apply_filters( "views_{$this->screen->id}", $views );
    260260
     261                $this->screen->render_screen_reader_content( 'heading_views' );
    261262?>
    262263<div class="wp-filter">
    263264        <ul class="filter-links">
     
    292293
    293294?>
    294295<div class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>">
    295 
     296<?php
     297        $this->screen->render_screen_reader_content( 'heading_list' );
     298?>
    296299        <div id="the-list"<?php echo $data_attr; ?>>
    297300                <?php $this->display_rows_or_placeholder(); ?>
    298301        </div>
  • src/wp-admin/includes/class-wp-screen.php

     
    142142         */
    143143        private $_help_sidebar = '';
    144144
     145        /**
     146         * The accessible hidden headings and text associated with the screen, if any.
     147         *
     148         * @since 4.4.0
     149         * @access private
     150         * @var array
     151         */
     152        private $_screen_reader_content = array();
     153
    145154        /**
    146155         * Stores old string-based help.
    147156         *
     
    644653                return $this->columns;
    645654        }
    646655
     656        /**
     657         * Get the accessible hidden headings and text used in the screen.
     658         *
     659         * @since 4.4.0
     660         *
     661         * @see set_screen_reader_content() For more information on the array format.
     662         *
     663         * @return array An associative array of screen reader text strings.
     664         */
     665        public function get_screen_reader_content() {
     666                return $this->_screen_reader_content;
     667        }
     668
    647669        /**
     670         * Get a screen reader text string.
     671         *
     672         * @since 4.4.0
     673         *
     674         * @param string $key Screen reader text array named key.
     675         * @return string Screen reader text string.
     676         */
     677        public function get_screen_reader_text( $key ) {
     678                if ( ! isset( $this->_screen_reader_content[ $key ] ) ) {
     679                        return null;
     680                }
     681                return $this->_screen_reader_content[ $key ];
     682        }
     683
     684        /**
     685         * Add accessible hidden headings and text for the screen.
     686         *
     687         * @since 4.4.0
     688         *
     689         * @param array $content {
     690         *     An associative array of screen reader text strings.
     691         *
     692         *     @type string $heading_views      Screen reader text for the filter links heading.
     693         *                                      Default 'Filter items list'.
     694         *     @type string $heading_pagination Screen reader text for the pagination heading.
     695         *                                      Default 'Items list navigation'.
     696         *     @type string heading_list        Screen reader text for the items list heading.
     697         *                                      Default 'Items list'.
     698         * }
     699         */
     700        public function set_screen_reader_content( $content = array() ) {
     701                $defaults = array(
     702                        'heading_views'      => __( 'Filter items list' ),
     703                        'heading_pagination' => __( 'Items list navigation' ),
     704                        'heading_list'       => __( 'Items list' ),
     705                );
     706                $content = wp_parse_args( $content, $defaults );
     707
     708                $this->_screen_reader_content = $content;
     709        }
     710
     711        /**
     712         * Remove all the accessible hidden headings and text for the screen.
     713         *
     714         * @since 4.4.0
     715         */
     716        public function remove_screen_reader_content() {
     717                $this->_screen_reader_content = array();
     718        }
     719
     720        /**
    648721         * Render the screen's help section.
    649722         *
    650723         * This will trigger the deprecated filters for backwards compatibility.
     
    10641137                </div>
    10651138                <?php
    10661139        }
     1140
     1141        /**
     1142         * Render screen reader text.
     1143         *
     1144         * @since 4.4.0
     1145         *
     1146         * @param string $key The screen reader text array named key.
     1147         * @param string $tag Optional. The HTML tag to wrap the screen reader text. Default h2.
     1148         */
     1149        public function render_screen_reader_content( $key = '', $tag = 'h2' ) {
     1150
     1151                if ( ! isset( $this->_screen_reader_content[ $key ] ) ) {
     1152                        return;
     1153                }
     1154                echo "<$tag class='screen-reader-text'>" . $this->_screen_reader_content[ $key ] . "</$tag>";
     1155        }
    10671156}
  • 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()->set_screen_reader_content( 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()->set_screen_reader_content( 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()->set_screen_reader_content( 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()->set_screen_reader_content( 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()->set_screen_reader_content( 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

     
    172172        '<p>' . __('<a href="https://wordpress.org/support/forum/multisite/" target="_blank">Support Forums</a>') . '</p>'
    173173);
    174174
     175get_current_screen()->set_screen_reader_content( array(
     176        'heading_views'      => __( 'Filter users list' ),
     177        'heading_pagination' => __( 'Users list navigation' ),
     178        'heading_list'       => __( 'Users list' ),
     179) );
     180
    175181require_once( ABSPATH . 'wp-admin/admin-header.php' );
    176182
    177183if ( 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()->set_screen_reader_content( 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

     
    426426        '<p>' . __('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
    427427);
    428428
     429get_current_screen()->set_screen_reader_content( array(
     430        'heading_views'      => __( 'Filter plugins list' ),
     431        'heading_pagination' => __( 'Plugins list navigation' ),
     432        'heading_list'       => __( 'Plugins list' ),
     433) );
     434
    429435$title = __('Plugins');
    430436$parent_file = 'plugins.php';
    431437
  • src/wp-admin/theme-install.php

     
    128128        <?php install_themes_upload(); ?>
    129129        </div>
    130130
     131        <h2 class="screen-reader-text"><?php _e( 'Filter themes list' ); ?></h2>
     132
    131133        <div class="wp-filter">
    132134                <div class="filter-count">
    133135                        <span class="count theme-count"></span>
     
    171173                        </div>
    172174                </div>
    173175        </div>
     176        <h2 class="screen-reader-text"><?php _e( 'Themes list' ); ?></h2>
    174177        <div class="theme-browser content-filterable"></div>
    175178        <div class="theme-install-overlay wp-full-overlay expanded"></div>
    176179
  • src/wp-admin/upload.php

     
    204204        '<p>' . __( '<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>'
    205205);
    206206
     207get_current_screen()->set_screen_reader_content( array(
     208        'heading_views'      => __( 'Filter media items list' ),
     209        'heading_pagination' => __( 'Media items list navigation' ),
     210        'heading_list'       => __( 'Media items list' ),
     211) );
     212
    207213require_once( ABSPATH . 'wp-admin/admin-header.php' );
    208214?>
    209215
  • src/wp-admin/users.php

     
    6868    '<p>' . __('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
    6969);
    7070
     71get_current_screen()->set_screen_reader_content( array(
     72        'heading_views'      => __( 'Filter users list' ),
     73        'heading_pagination' => __( 'Users list navigation' ),
     74        'heading_list'       => __( 'Users list' ),
     75) );
     76
    7177if ( empty($_REQUEST) ) {
    7278        $referer = '<input type="hidden" name="wp_http_referer" value="'. esc_attr( wp_unslash( $_SERVER['REQUEST_URI'] ) ) . '" />';
    7379} elseif ( isset($_REQUEST['wp_http_referer']) ) {
  • src/wp-includes/post-functions.php

     
    13221322 * - remove_featured_image - Default is Remove featured image.
    13231323 * - use_featured_image - Default is Use as featured image.
    13241324 * - menu_name - Default is the same as `name`.
     1325 * - views - String for the table views hidden heading.
     1326 * - pagination - String for the table pagination hidden heading.
     1327 * - list - String for the table hidden heading.
    13251328 *
    13261329 * Above, the first default value is for non-hierarchical post types (like posts)
    13271330 * and the second one is for hierarchical post types (like pages).
     
    13561359                'set_featured_image' => array( __( 'Set featured image' ), __( 'Set featured image' ) ),
    13571360                'remove_featured_image' => array( __( 'Remove featured image' ), __( 'Remove featured image' ) ),
    13581361                'use_featured_image' => array( __( 'Use as featured image' ), __( 'Use as featured image' ) ),
     1362                'views' => array( __( 'Filter posts list' ), __( 'Filter pages list' ) ),
     1363                'pagination' => array( __( 'Posts list navigation' ), __( 'Pages list navigation' ) ),
     1364                'list' => array( __( 'Posts list' ), __( 'Pages list' ) ),
    13591365        );
    13601366        $nohier_vs_hier_defaults['menu_name'] = $nohier_vs_hier_defaults['name'];
    13611367
  • src/wp-includes/taxonomy-functions.php

     
    495495 * - 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.
    496496 * - not_found - Default is "No tags found"/"No categories found", used in the meta box and taxonomy list table.
    497497 * - no_terms - Default is "No tags"/"No categories", used in the posts and media list tables.
     498 * - pagination - String for the table pagination hidden heading.
     499 * - list - String for the table hidden heading.
    498500 *
    499501 * Above, the first default value is for non-hierarchical taxonomies (like tags) and the second one is for hierarchical taxonomies (like categories).
    500502 *
     
    534536                'choose_from_most_used' => array( __( 'Choose from the most used tags' ), null ),
    535537                'not_found' => array( __( 'No tags found.' ), __( 'No categories found.' ) ),
    536538                'no_terms' => array( __( 'No tags' ), __( 'No categories' ) ),
     539                'pagination' => array( __( 'Tags list navigation' ), __( 'Categories list navigation' ) ),
     540                'list' => array( __( 'Tags list' ), __( 'Categories list' ) ),
    537541        );
    538542        $nohier_vs_hier_defaults['menu_name'] = $nohier_vs_hier_defaults['name'];
    539543