X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/38ca813a0e312e2768e5b9519f0415cd0aa84781..8f374b7233bc2815ccc387e448d208c5434eb961:/wp-admin/includes/class-wp-list-table.php diff --git a/wp-admin/includes/class-wp-list-table.php b/wp-admin/includes/class-wp-list-table.php index 6420ee78..6de7abf5 100644 --- a/wp-admin/includes/class-wp-list-table.php +++ b/wp-admin/includes/class-wp-list-table.php @@ -91,6 +91,9 @@ class WP_List_Table { if ( !$args['plural'] ) $args['plural'] = $screen->base; + $args['plural'] = sanitize_key( $args['plural'] ); + $args['singular'] = sanitize_key( $args['singular'] ); + $this->_args = $args; if ( $args['ajax'] ) { @@ -209,7 +212,7 @@ class WP_List_Table { ?> %s\n", selected( $m, $year . $month, false ), esc_attr( $arc_row->year . $month ), - $wp_locale->get_month( $month ) . " $year" + /* translators: 1: month name, 2: 4-digit year */ + sprintf( __( '%1$s %2$d' ), $wp_locale->get_month( $month ), $year ) ); } ?> @@ -480,7 +484,7 @@ class WP_List_Table { if ( empty( $this->_pagination_args ) ) return; - extract( $this->_pagination_args ); + extract( $this->_pagination_args, EXTR_SKIP ); $output = '' . sprintf( _n( '1 item', '%s items', $total_items ), number_format_i18n( $total_items ) ) . ''; @@ -515,9 +519,8 @@ class WP_List_Table { if ( 'bottom' == $which ) $html_current_page = $current; else - $html_current_page = sprintf( "", + $html_current_page = sprintf( "", esc_attr__( 'Current page' ), - esc_attr( 'paged' ), $current, strlen( $total_pages ) ); @@ -539,7 +542,10 @@ class WP_List_Table { '»' ); - $output .= "\n" . join( "\n", $page_links ) . ''; + $pagination_links_class = 'pagination-links'; + if ( ! empty( $infinite_scroll ) ) + $pagination_links_class = ' hide-if-js'; + $output .= "\n" . join( "\n", $page_links ) . ''; if ( $total_pages ) $page_class = $total_pages < 2 ? ' one-page' : ''; @@ -868,7 +874,7 @@ class WP_List_Table { $this->prepare_items(); extract( $this->_args ); - extract( $this->_pagination_args ); + extract( $this->_pagination_args, EXTR_SKIP ); ob_start(); if ( ! empty( $_REQUEST['no_placeholder'] ) ) @@ -897,12 +903,16 @@ class WP_List_Table { * @access private */ function _js_vars() { + $current_screen = get_current_screen(); + $args = array( - 'class' => get_class( $this ), - 'screen' => get_current_screen() + 'class' => get_class( $this ), + 'screen' => array( + 'id' => $current_screen->id, + 'base' => $current_screen->base, + ) ); printf( "\n", json_encode( $args ) ); } } -?>