Make WordPress Core

Ticket #32147: 32147.6.patch

File 32147.6.patch, 17.9 KB (added by afercia, 9 years ago)
  • 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()->set_screen_reader_content( 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()->set_screen_reader_content( 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()->set_screen_reader_content( 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

     
    394394
    395395                $this->display_tablenav( 'top' );
    396396
     397                $this->screen->render_screen_reader_content( 'heading_list' );
     398
    397399?>
    398400<table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>">
    399401        <thead>
  • src/wp-admin/includes/class-wp-list-table.php

     
    380380                if ( empty( $views ) )
    381381                        return;
    382382
     383                $this->screen->render_screen_reader_content( 'heading_views' );
     384
    383385                echo "<ul class='subsubsub'>\n";
    384386                foreach ( $views as $class => $view ) {
    385387                        $views[ $class ] = "\t<li class='$class'>$view";
     
    693695                        $infinite_scroll = $this->_pagination_args['infinite_scroll'];
    694696                }
    695697
     698                if ( 'top' === $which && $total_pages > 1 ) {
     699                        $this->screen->render_screen_reader_content( 'heading_pagination' );
     700                }
     701
    696702                $output = '<span class="displaying-num">' . sprintf( _n( '%s item', '%s items', $total_items ), number_format_i18n( $total_items ) ) . '</span>';
    697703
    698704                $current = $this->get_pagenum();
     
    10201026                $singular = $this->_args['singular'];
    10211027
    10221028                $this->display_tablenav( 'top' );
     1029
     1030                $this->screen->render_screen_reader_content( 'heading_list' );
    10231031?>
    10241032<table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>">
    10251033        <thead>
  • src/wp-admin/includes/class-wp-media-list-table.php

     
    200200                global $mode;
    201201
    202202                $views = $this->get_views();
     203
     204                $this->screen->render_screen_reader_content( 'heading_views' );
    203205?>
    204206<div class="wp-filter">
    205207        <div class="filter-items">
  • src/wp-admin/includes/class-wp-plugin-install-list-table.php

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

     
    331331        private $_help_sidebar = '';
    332332
    333333        /**
     334         * The accessible hidden headings and text associated with the screen, if any.
     335         *
     336         * @since 4.3.0
     337         * @access private
     338         * @var array
     339         */
     340        private $_screen_reader_content = array();
     341
     342        /**
    334343         * Stores old string-based help.
    335344         *
    336345         * @static
     
    807816        }
    808817
    809818        /**
     819         * Get the accessible hidden headings and text used in the screen.
     820         *
     821         * @since 4.3.0
     822         *
     823         * @see set_screen_reader_content() For more information on the array format.
     824         *
     825         * @return array An associative array of screen reader text strings.
     826         */
     827        public function get_screen_reader_content() {
     828                return $this->_screen_reader_content;
     829        }
     830
     831        /**
     832         * Get a screen reader text string.
     833         *
     834         * @since 4.3.0
     835         *
     836         * @param string $key Screen reader text array named key.
     837         * @return string Screen reader text string.
     838         */
     839        public function get_screen_reader_text( $key ) {
     840                if ( ! isset( $this->_screen_reader_content[ $key ] ) ) {
     841                        return null;
     842                }
     843                return $this->_screen_reader_content[ $key ];
     844        }
     845
     846        /**
     847         * Add accessible hidden headings and text for the screen.
     848         *
     849         * @since 4.3.0
     850         *
     851         * @param array $content {
     852         *     An associative array of screen reader text strings.
     853         *
     854         *     @type string $heading_views      Screen reader text for the filter links heading.
     855         *                                      Default 'Filter items list'.
     856         *     @type string $heading_pagination Screen reader text for the pagination heading.
     857         *                                      Default 'Items list navigation'.
     858         *     @type string heading_list        Screen reader text for the items list heading.
     859         *                                      Default 'Items list'.
     860         * }
     861         */
     862        public function set_screen_reader_content( $content = array() ) {
     863                $defaults = array(
     864                        'heading_views'      => __( 'Filter items list' ),
     865                        'heading_pagination' => __( 'Items list navigation' ),
     866                        'heading_list'       => __( 'Items list' ),
     867                );
     868                $content = wp_parse_args( $content, $defaults );
     869
     870                $this->_screen_reader_content = $content;
     871        }
     872
     873        /**
     874         * Remove all the accessible hidden headings and text for the screen.
     875         *
     876         * @since 4.3.0
     877         */
     878        public function remove_screen_reader_content() {
     879                $this->_screen_reader_content = array();
     880        }
     881
     882        /**
    810883         * Render the screen's help section.
    811884         *
    812885         * This will trigger the deprecated filters for backwards compatibility.
     
    12171290                </div>
    12181291                <?php
    12191292        }
     1293
     1294        /**
     1295         * Render screen reader text.
     1296         *
     1297         * @since 4.3.0
     1298         *
     1299         * @param string $key The screen reader text array named key.
     1300         * @param string $tag Optional. The HTML tag to wrap the screen reader text. Default h2.
     1301         */
     1302        public function render_screen_reader_content( $key = '', $tag = 'h2' ) {
     1303
     1304                if ( ! isset( $this->_screen_reader_content[ $key ] ) ) {
     1305                        return;
     1306                }
     1307                echo "<$tag class='screen-reader-text'>" . $this->_screen_reader_content[ $key ] . "</$tag>";
     1308        }
    12201309}
  • 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

     
    280280        '<p>' . __('<a href="https://wordpress.org/support/forum/multisite/" target="_blank">Support Forums</a>') . '</p>'
    281281);
    282282
     283get_current_screen()->set_screen_reader_content( array(
     284        'heading_views'      => __( 'Filter users list' ),
     285        'heading_pagination' => __( 'Users list navigation' ),
     286        'heading_list'       => __( 'Users list' ),
     287) );
     288
    283289require_once( ABSPATH . 'wp-admin/admin-header.php' );
    284290
    285291if ( 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

     
    395395        '<p>' . __('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
    396396);
    397397
     398get_current_screen()->set_screen_reader_content( array(
     399        'heading_views'      => __( 'Filter plugins list' ),
     400        'heading_pagination' => __( 'Plugins list navigation' ),
     401        'heading_list'       => __( 'Plugins list' ),
     402) );
     403
    398404$title = __('Plugins');
    399405$parent_file = 'plugins.php';
    400406
  • 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()->set_screen_reader_content( 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()->set_screen_reader_content( 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

     
    16301630 * - remove_featured_image - Default is Remove featured image.
    16311631 * - use_featured_image - Default is Use as featured image.
    16321632 * - menu_name - Default is the same as `name`.
     1633 * - views - String for the table views hidden heading.
     1634 * - pagination - String for the table pagination hidden heading.
     1635 * - list - String for the table hidden heading.
    16331636 *
    16341637 * Above, the first default value is for non-hierarchical post types (like posts)
    16351638 * and the second one is for hierarchical post types (like pages).
     
    16591662                'set_featured_image' => array( __( 'Set featured image' ), __( 'Set featured image' ) ),
    16601663                'remove_featured_image' => array( __( 'Remove featured image' ), __( 'Remove featured image' ) ),
    16611664                'use_featured_image' => array( __( 'Use as featured image' ), __( 'Use as featured image' ) ),
     1665                'views' => array( __( 'Filter posts list' ), __( 'Filter pages list' ) ),
     1666                'pagination' => array( __( 'Posts list navigation' ), __( 'Pages list navigation' ) ),
     1667                'list' => array( __( 'Posts list' ), __( 'Pages list' ) ),
    16621668        );
    16631669        $nohier_vs_hier_defaults['menu_name'] = $nohier_vs_hier_defaults['name'];
    16641670
  • src/wp-includes/taxonomy.php

     
    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.
    475475 * - no_terms - Default is "No tags"/"No categories", used in the posts and media list tables.
     476 * - pagination - String for the table pagination hidden heading.
     477 * - list - String for the table hidden heading.
    476478 *
    477479 * Above, the first default value is for non-hierarchical taxonomies (like tags) and the second one is for hierarchical taxonomies (like categories).
    478480 *
     
    511513                'choose_from_most_used' => array( __( 'Choose from the most used tags' ), null ),
    512514                'not_found' => array( __( 'No tags found.' ), __( 'No categories found.' ) ),
    513515                'no_terms' => array( __( 'No tags' ), __( 'No categories' ) ),
     516                'pagination' => array( __( 'Tags list navigation' ), __( 'Categories list navigation' ) ),
     517                'list' => array( __( 'Tags list' ), __( 'Categories list' ) ),
    514518        );
    515519        $nohier_vs_hier_defaults['menu_name'] = $nohier_vs_hier_defaults['name'];
    516520