WordPress.org

Make WordPress Core

Ticket #32147: 32147.patch

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

     
    529529}
    530530
    531531.tablenav .no-pages,
    532 .tablenav .one-page .pagination-links {
     532.tablenav .one-page .pagination-links,
     533.tablenav .one-page .pagination-heading {
    533534        display: none;
    534535}
    535536
  • 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_table_views'      => __( 'Filter comments to display' ),
     141        'heading_table_pagination' => __( 'Comments navigation' ),
     142) );
     143
    139144require_once( ABSPATH . 'wp-admin/admin-header.php' );
    140145?>
    141146
  • src/wp-admin/edit-tags.php

     
    4141
    4242add_screen_option( 'per_page', array( 'default' => 20, 'option' => 'edit_' . $tax->name . '_per_page' ) );
    4343
     44get_current_screen()->add_a11y_info( array(
     45        'heading_table_pagination' => $tax->labels->pagination,
     46) );
     47
    4448$location = false;
    4549
    4650switch ( $wp_list_table->current_action() ) {
  • src/wp-admin/edit.php

     
    232232        '<p>' . __('<a href="https://codex.wordpress.org/Pages_Screen" target="_blank">Documentation on Managing Pages</a>') . '</p>' .
    233233        '<p>' . __('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
    234234        );
     235
    235236}
    236237
     238get_current_screen()->add_a11y_info( array(
     239        'heading_table_views'      => $post_type_object->labels->filter_views,
     240        'heading_table_pagination' => $post_type_object->labels->pagination,
     241) );
     242
    237243add_screen_option( 'per_page', array( 'default' => 20, 'option' => 'edit_' . $post_type . '_per_page' ) );
    238244
    239245$bulk_counts = array(
  • 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_table_views'] ) ) {
     382                        $heading = '<h2 class="screen-reader-text filter-views-heading">' . $this->screen->a11y_info['heading_table_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                }
     
    686692                        $infinite_scroll = $this->_pagination_args['infinite_scroll'];
    687693                }
    688694
    689                 $output = '<span class="displaying-num">' . sprintf( _n( '1 item', '%s items', $total_items ), number_format_i18n( $total_items ) ) . '</span>';
     695                if ( isset( $this->screen->a11y_info['heading_table_pagination'] ) ) {
     696                        $heading = '<h2 class="screen-reader-text pagination-heading">' . $this->screen->a11y_info['heading_table_pagination'] . '</h2>';
     697                } else {
     698                        $heading = '';
     699                }
    690700
     701                $output = $heading . '<span class="displaying-num">' . sprintf( _n( '1 item', '%s items', $total_items ), number_format_i18n( $total_items ) ) . '</span>';
     702
    691703                $current = $this->get_pagenum();
    692704
    693705                $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
  • src/wp-admin/includes/class-wp-media-list-table.php

     
    163163                global $mode;
    164164
    165165                $views = $this->get_views();
     166
     167                if ( isset( $this->screen->a11y_info['heading_table_views'] ) ) {
     168                        echo '<h2 class="screen-reader-text filter-views-heading">' . $this->screen->a11y_info['heading_table_views'] . '</h2>';
     169                }
    166170?>
    167171<div class="wp-filter">
    168172        <div class="filter-items">
  • src/wp-admin/includes/class-wp-plugin-install-list-table.php

     
    232232                /** This filter is documented in wp-admin/inclues/class-wp-list-table.php */
    233233                $views = apply_filters( "views_{$this->screen->id}", $views );
    234234
     235                if ( isset( $this->screen->a11y_info['heading_table_views'] ) ) {
     236                        echo '<h2 class="screen-reader-text filter-views-heading">' . $this->screen->a11y_info['heading_table_views'] . '</h2>';
     237                }
     238
    235239?>
    236240<div class="wp-filter">
    237241        <ul class="filter-links">
  • src/wp-admin/includes/screen.php

     
    322322        private $_help_sidebar = '';
    323323
    324324        /**
     325         * The accessibility information associated with the screen, if any.
     326         *
     327         * @since 4.3.0
     328         * @var array
     329         * @access public
     330         */
     331        public $a11y_info = array();
     332
     333        /**
    325334         * Stores old string-based help.
    326335         */
    327336        private static $_old_compat_help = array();
     
    781790                return $this->columns;
    782791        }
    783792
     793        /**
     794         * Add accessibility related informations.
     795         *
     796         * @since 4.3.0
     797         *
     798         * @param array $args An associative array with additional information useful for accessibility.
     799         * - string - heading_table_views      - The table views hidden heading text.
     800         * - string - heading_table_pagination - The table pagination hidden heading text.
     801         */
     802        public function add_a11y_info( $args = array() ) {
     803                $defaults = array(
     804                        'heading_table_views'      => __( 'Filter items to display' ),
     805                        'heading_table_pagination' => __( 'Items navigation' ),
     806                );
     807                $args = wp_parse_args( $args, $defaults );
     808
     809                $this->a11y_info = $args;
     810        }
     811
    784812        /**
    785813         * Render the screen's help section.
    786814         *
  • 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_table_views'      => __( 'Filter site themes to display' ),
     38        'heading_table_pagination' => __( 'Site themes navigation' ),
     39) );
     40
    3641$wp_list_table = _get_list_table('WP_MS_Themes_List_Table');
    3742
    3843$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_table_views'      => __( 'Filter site users to display' ),
     41        'heading_table_pagination' => __( 'Site users navigation' ),
     42) );
     43
    3944$_SERVER['REQUEST_URI'] = remove_query_arg( 'update', $_SERVER['REQUEST_URI'] );
    4045$referer = remove_query_arg( 'update', wp_get_referer() );
    4146
  • 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_table_pagination' => __( 'Sites navigation' ),
     51) );
     52
    4953$id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0;
    5054
    5155if ( 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_table_views'      => __( 'Filter themes to display' ),
     256        'heading_table_pagination' => __( 'Themes navigation' ),
     257) );
     258
    254259$title = __('Themes');
    255260$parent_file = 'themes.php';
    256261
  • 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_table_views'      => __( 'Filter users to display' ),
     281        'heading_table_pagination' => __( 'Users navigation' ),
     282) );
     283
    279284require_once( ABSPATH . 'wp-admin/admin-header.php' );
    280285
    281286if ( 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_table_views'      => __( 'Filter plugins to display' ),
     93        'heading_table_pagination' => __( 'Plugins navigation' ),
     94) );
     95
    9196/**
    9297 * WordPress Administration Template Header.
    9398 */
  • 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_table_views'      => __( 'Filter plugins to display' ),
     397        'heading_table_pagination' => __( 'Plugins navigation' ),
     398) );
     399
    395400$title = __('Plugins');
    396401$parent_file = 'plugins.php';
    397402
  • src/wp-admin/theme-install.php

     
    126126        <?php install_themes_upload(); ?>
    127127        </div>
    128128
     129        <h2 class="screen-reader-text"><?php _e( 'Filter themes to display' ); ?></h2>
     130
    129131        <div class="wp-filter">
    130132                <div class="filter-count">
    131133                        <span class="count theme-count"></span>
  • 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_table_views'      => __( 'Filter media items to display' ),
     207        'heading_table_pagination' => __( 'Media items navigation' ),
     208) );
     209
    205210require_once( ABSPATH . 'wp-admin/admin-header.php' );
    206211?>
    207212
  • 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_table_views'      => __( 'Filter users to display' ),
     68        'heading_table_pagination' => __( 'Users navigation' ),
     69) );
     70
    6671if ( empty($_REQUEST) ) {
    6772        $referer = '<input type="hidden" name="wp_http_referer" value="'. esc_attr( wp_unslash( $_SERVER['REQUEST_URI'] ) ) . '" />';
    6873} elseif ( isset($_REQUEST['wp_http_referer']) ) {
  • src/wp-includes/post.php

     
    16161616 *                       ones the default is 'Parent Page:'.
    16171617 * - all_items - String for the submenu. Default is All Posts/All Pages.
    16181618 * - menu_name - Default is the same as `name`.
     1619 * - filter_views - String for the table views hidden heading.
     1620 * - pagination - String for the table pagination hidden heading.
    16191621 *
    16201622 * Above, the first default value is for non-hierarchical post types (like posts)
    16211623 * and the second one is for hierarchical post types (like pages).
     
    16391641                'not_found' => array( __('No posts found.'), __('No pages found.') ),
    16401642                'not_found_in_trash' => array( __('No posts found in Trash.'), __('No pages found in Trash.') ),
    16411643                'parent_item_colon' => array( null, __('Parent Page:') ),
    1642                 'all_items' => array( __( 'All Posts' ), __( 'All Pages' ) )
     1644                'all_items' => array( __( 'All Posts' ), __( 'All Pages' ) ),
     1645                'filter_views' => array( __( 'Filter posts to display' ), __( 'Filter pages to display' ) ),
     1646                'pagination' => array( __( 'Posts navigation' ), __( 'Pages navigation' ) ),
    16431647        );
    16441648        $nohier_vs_hier_defaults['menu_name'] = $nohier_vs_hier_defaults['name'];
    16451649
  • src/wp-includes/taxonomy.php

     
    460460 * - 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.
    461461 * - 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.
    462462 * - not_found - Default is "No tags found"/"No categories found", used in the meta box and taxonomy list table.
     463 * - pagination - String for the table pagination hidden heading.
    463464 *
    464465 * Above, the first default value is for non-hierarchical taxonomies (like tags) and the second one is for hierarchical taxonomies (like categories).
    465466 *
     
    494495                'add_or_remove_items' => array( __( 'Add or remove tags' ), null ),
    495496                'choose_from_most_used' => array( __( 'Choose from the most used tags' ), null ),
    496497                'not_found' => array( __( 'No tags found.' ), __( 'No categories found.' ) ),
     498                'pagination' => array( __( 'Tags navigation' ), __( 'Categories navigation' ) ),
    497499        );
    498500        $nohier_vs_hier_defaults['menu_name'] = $nohier_vs_hier_defaults['name'];
    499501