From 248c73b1cf1a0aa2c42815104864ce75359b0108 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Thu, 2 Apr 2015 23:48:26 +0000 Subject: [PATCH] Plugins Browser: Replace the download count with the number of Active installs of the plugin. Fixes #31865 git-svn-id: https://develop.svn.wordpress.org/trunk@31990 602fd350-edb4-49c9-b593-d223f7449a82 --- .../class-wp-plugin-install-list-table.php | 15 +++++++++++++-- src/wp-admin/includes/plugin-install.php | 17 ++++++++++++++--- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/src/wp-admin/includes/class-wp-plugin-install-list-table.php b/src/wp-admin/includes/class-wp-plugin-install-list-table.php index bcb2ff6cc7..e1a730610b 100644 --- a/src/wp-admin/includes/class-wp-plugin-install-list-table.php +++ b/src/wp-admin/includes/class-wp-plugin-install-list-table.php @@ -105,7 +105,11 @@ class WP_Plugin_Install_List_Table extends WP_List_Table { $args = array( 'page' => $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(), 'installed_plugins' => $this->get_installed_plugin_slugs(), @@ -478,7 +482,14 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
- + = 1000000 ) { + $active_installs_text = _x( '1+ Million', 'Active plugin installs' ); + } else { + $active_installs_text = number_format_i18n( $plugin['active_installs'] ) . '+'; + } + printf( __( '%s Active Installs' ), $active_installs_text ); + ?>
wp_unslash( $_REQUEST['plugin'] ), 'is_ssl' => is_ssl(), - 'fields' => array( 'banners' => true, 'reviews' => true ) + 'fields' => array( + 'banners' => true, + 'reviews' => true, + 'downloaded' => false, + 'active_installs' => true + ) ) ); if ( is_wp_error( $api ) ) { @@ -458,8 +463,14 @@ function install_plugin_information() {
  • requires ); ?>
  • tested ) ) { ?>
  • tested; ?>
  • - downloaded ) ) { ?> -
  • downloaded ), number_format_i18n( $api->downloaded ) ); ?>
  • + active_installs ) ) { ?> +
  • active_installs >= 1000000 ) { + _ex( '1+ Million', 'Active plugin installs' ); + } else { + echo number_format_i18n( $api->active_installs ) . '+'; + } + ?>
  • slug ) && empty( $api->external ) ) { ?>
  • homepage ) ) { ?>