From 90a115e4b44fc863b179777d5912bbdbd773b45a Mon Sep 17 00:00:00 2001 From: Daryl Koopersmith Date: Sat, 3 Mar 2012 02:40:43 +0000 Subject: [PATCH] Partially revert [20100]. The list_args JS variable cannot be extended due to its use as an argument in fetch-list. see #19815. We should reattempt extending the args created in WP_List_Table, but will need to deprecate the current list_args to do so. Also, infinite scroll on themes pages is no longer broken. Go team. git-svn-id: https://develop.svn.wordpress.org/trunk@20104 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/class-wp-list-table.php | 5 +---- wp-admin/includes/class-wp-themes-list-table.php | 13 +++++++------ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/wp-admin/includes/class-wp-list-table.php b/wp-admin/includes/class-wp-list-table.php index eae5f9c1af..ee5f9f9b34 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( $extra_args = array() ) { + function _js_vars() { $current_screen = get_current_screen(); $args = array( @@ -914,9 +914,6 @@ 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-themes-list-table.php b/wp-admin/includes/class-wp-themes-list-table.php index a1d837453e..5cecb6b04a 100644 --- a/wp-admin/includes/class-wp-themes-list-table.php +++ b/wp-admin/includes/class-wp-themes-list-table.php @@ -125,12 +125,12 @@ class WP_Themes_List_Table extends WP_List_Table { $title = $theme->display('Name'); $version = $theme->display('Version'); $author = $theme->display('Author'); - + $activate_link = wp_nonce_url( "themes.php?action=activate&template=" . urlencode( $template ) . "&stylesheet=" . urlencode( $stylesheet ), 'switch-theme_' . $template ); $preview_link = esc_url( add_query_arg( array( 'preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'preview_iframe' => true, 'TB_iframe' => 'true' ), home_url( '/' ) ) ); - + $actions = array(); $actions[] = '' . __( 'Activate' ) . ''; @@ -140,9 +140,9 @@ class WP_Themes_List_Table extends WP_List_Table { $actions[] = '' . __( 'Delete' ) . ''; - + $actions = apply_filters( 'theme_action_links', $actions, $theme ); - + $actions = implode ( ' | ', $actions ); ?> @@ -153,7 +153,7 @@ class WP_Themes_List_Table extends WP_List_Table {

- + |
@@ -227,6 +227,7 @@ class WP_Themes_List_Table extends WP_List_Table { if ( is_array( $extra_args ) ) $args = array_merge( $args, $extra_args ); - parent::_js_vars( $args ); + printf( "\n", json_encode( $args ) ); + parent::_js_vars(); } }