Make WordPress Core

Ticket #32147: 32147.5.patch

File 32147.5.patch, 18.0 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="<?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";
     
    691693                        $infinite_scroll = $this->_pagination_args['infinite_scroll'];
    692694                }
    693695
     696                if ( 'top' === $which && $total_pages > 1 ) {
     697                        $this->screen->render_screen_reader_content( 'heading_pagination' );
     698                }
     699
    694700                $output = '<span class="displaying-num">' . sprintf( _n( '%s item', '%s items', $total_items ), number_format_i18n( $total_items ) ) . '</span>';
    695701
    696702                $current = $this->get_pagenum();
     
    980986                $singular = $this->_args['singular'];
    981987
    982988                $this->display_tablenav( 'top' );
     989
     990                $this->screen->render_screen_reader_content( 'heading_list' );
    983991?>
    984992<table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>">
    985993        <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

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

     
    16291629 * - remove_featured_image - Default is Remove featured image.
    16301630 * - use_featured_image - Default is Use as featured image.
    16311631 * - menu_name - Default is the same as `name`.
     1632 * - views - String for the table views hidden heading.
     1633 * - pagination - String for the table pagination hidden heading.
     1634 * - list - String for the table hidden heading.
    16321635 *
    16331636 * Above, the first default value is for non-hierarchical post types (like posts)
    16341637 * and the second one is for hierarchical post types (like pages).
     
    16581661                'set_featured_image' => array( __( 'Set featured image' ), __( 'Set featured image' ) ),
    16591662                'remove_featured_image' => array( __( 'Remove featured image' ), __( 'Remove featured image' ) ),
    16601663                'use_featured_image' => array( __( 'Use as featured image' ), __( 'Use as featured image' ) ),
     1664                'views' => array( __( 'Filter posts list' ), __( 'Filter pages list' ) ),
     1665                'pagination' => array( __( 'Posts list navigation' ), __( 'Pages list navigation' ) ),
     1666                'list' => array( __( 'Posts list' ), __( 'Pages list' ) ),
    16611667        );
    16621668        $nohier_vs_hier_defaults['menu_name'] = $nohier_vs_hier_defaults['name'];
    16631669
  • 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