diff --git a/wp-admin/includes/class-wp-list-table.php b/wp-admin/includes/class-wp-list-table.php
index ee5f9f9b34..eae5f9c1af 100644
--- a/wp-admin/includes/class-wp-list-table.php
+++ b/wp-admin/includes/class-wp-list-table.php
@@ -903,7 +903,7 @@ class WP_List_Table {
*
* @access private
*/
- function _js_vars() {
+ function _js_vars( $extra_args = array() ) {
$current_screen = get_current_screen();
$args = array(
@@ -914,6 +914,9 @@ class WP_List_Table {
)
);
+ if ( is_array( $extra_args ) )
+ $args = array_merge( $args, $extra_args );
+
printf( "\n", json_encode( $args ) );
}
}
diff --git a/wp-admin/includes/class-wp-theme-install-list-table.php b/wp-admin/includes/class-wp-theme-install-list-table.php
index 82841528ef..5d4efce59f 100644
--- a/wp-admin/includes/class-wp-theme-install-list-table.php
+++ b/wp-admin/includes/class-wp-theme-install-list-table.php
@@ -170,7 +170,7 @@ class WP_Theme_Install_List_Table extends WP_Themes_List_Table {
* @uses $type Global; type of search.
*/
function _js_vars() {
- global $tab, $type;
- parent::_js_vars( compact( $tab, $type ) );
+ global $tab, $type;
+ parent::_js_vars( compact( 'tab', 'type' ) );
}
}
diff --git a/wp-admin/includes/class-wp-themes-list-table.php b/wp-admin/includes/class-wp-themes-list-table.php
index e1ce61caa4..a1d837453e 100644
--- a/wp-admin/includes/class-wp-themes-list-table.php
+++ b/wp-admin/includes/class-wp-themes-list-table.php
@@ -217,21 +217,16 @@ class WP_Themes_List_Table extends WP_List_Table {
function _js_vars( $extra_args = array() ) {
$search_string = isset( $_REQUEST['s'] ) ? esc_attr( stripslashes( $_REQUEST['s'] ) ) : '';
- $total_pages = 1;
- if ( ! empty( $this->_pagination_args['total_pages'] ) )
- $total_pages = $this->_pagination_args['total_pages'];
-
$args = array(
'search' => $search_string,
'features' => $this->features,
'paged' => $this->get_pagenum(),
- 'total_pages' => $total_pages,
+ 'total_pages' => ! empty( $this->_pagination_args['total_pages'] ) ? $this->_pagination_args['total_pages'] : 1,
);
if ( is_array( $extra_args ) )
- $args = array_merge( $args, $extra_args );
+ $args = array_merge( $args, $extra_args );
- printf( "\n", json_encode( $args ) );
- parent::_js_vars();
+ parent::_js_vars( $args );
}
}