X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/849f15aeed7a5e39314057bdc0064d8edd60dd7d..ef91a7f4f3c6468973e192335a27ec0e0faca0b5:/wp-admin/includes/class-wp-plugin-install-list-table.php?ds=inline diff --git a/wp-admin/includes/class-wp-plugin-install-list-table.php b/wp-admin/includes/class-wp-plugin-install-list-table.php index 07bfa0c7..cd718360 100644 --- a/wp-admin/includes/class-wp-plugin-install-list-table.php +++ b/wp-admin/includes/class-wp-plugin-install-list-table.php @@ -1,18 +1,32 @@ $paged, 'per_page' => $per_page, - 'fields' => array( 'last_updated' => true, 'downloaded' => true, 'icons' => true ), + 'fields' => array( + 'last_updated' => true, + 'icons' => true, + 'active_installs' => true + ), // Send the locale and installed plugin slugs to the API so it can provide context-sensitive results. - 'locale' => get_locale(), + 'locale' => get_user_locale(), 'installed_plugins' => $this->get_installed_plugin_slugs(), ); @@ -140,8 +169,13 @@ class WP_Plugin_Install_List_Table extends WP_List_Table { break; case 'favorites': - $user = isset( $_GET['user'] ) ? wp_unslash( $_GET['user'] ) : get_user_option( 'wporg_favorites' ); - update_user_meta( get_current_user_id(), 'wporg_favorites', $user ); + $action = 'save_wporg_username_' . get_current_user_id(); + if ( isset( $_GET['_wpnonce'] ) && wp_verify_nonce( wp_unslash( $_GET['_wpnonce'] ), $action ) ) { + $user = isset( $_GET['user'] ) ? wp_unslash( $_GET['user'] ) : get_user_option( 'wporg_favorites' ); + update_user_meta( get_current_user_id(), 'wporg_favorites', $user ); + } else { + $user = get_user_option( 'wporg_favorites' ); + } if ( $user ) $args['user'] = $user; else @@ -156,17 +190,16 @@ class WP_Plugin_Install_List_Table extends WP_List_Table { } /** - * Filter API request arguments for each Plugin Install screen tab. + * Filters API request arguments for each Plugin Install screen tab. * * The dynamic portion of the hook name, `$tab`, refers to the plugin install tabs. - * Default tabs are 'dashboard', 'search', 'upload', 'featured', 'popular', 'new', - * and 'favorites'. + * Default tabs include 'featured', 'popular', 'recommended', 'favorites', and 'upload'. * * @since 3.7.0 * * @param array|bool $args Plugin Install API arguments. */ - $args = apply_filters( "install_plugins_table_api_args_$tab", $args ); + $args = apply_filters( "install_plugins_table_api_args_{$tab}", $args ); if ( !$args ) return; @@ -194,6 +227,9 @@ class WP_Plugin_Install_List_Table extends WP_List_Table { } } + /** + * @access public + */ public function no_items() { if ( isset( $this->error ) ) { $message = $this->error->get_error_message() . '
'; @@ -203,12 +239,19 @@ class WP_Plugin_Install_List_Table extends WP_List_Table { echo '