Make WordPress Core


Ignore:
Timestamp:
03/10/2015 03:31:54 PM (9 years ago)
Author:
ocean90
Message:

Screen Options: Improve items per page option label.

Previously the label just said "Posts", "Pages", or "Comments". This was bad in terms of accessibility and internationalization because of missing context.
This change adds a default label "Number of items per page:" to WP_Screen->render_per_page_options() and removes all the existing one-word labels.

props afercia.
fixes #31349, #15576.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/edit.php

    r31200 r31696  
    166166wp_enqueue_script('heartbeat');
    167167
    168 $title = $post_type_object->labels->name;
    169 
    170168if ( 'post' == $post_type ) {
    171169    get_current_screen()->add_help_tab( array(
     
    235233}
    236234
    237 add_screen_option( 'per_page', array( 'label' => $title, 'default' => 20, 'option' => 'edit_' . $post_type . '_per_page' ) );
     235add_screen_option( 'per_page', array( 'default' => 20, 'option' => 'edit_' . $post_type . '_per_page' ) );
    238236
    239237$bulk_counts = array(
Note: See TracChangeset for help on using the changeset viewer.