From 02403eadd1fce0b8d78dc5c96648c6588e470aa3 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Thu, 2 Apr 2015 23:49:27 +0000 Subject: [PATCH] Plugins Browser: Replace the download count with the number of Active installs of the plugin. Fixes #31865 Built from https://develop.svn.wordpress.org/trunk@31990 git-svn-id: http://core.svn.wordpress.org/trunk@31969 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- .../class-wp-plugin-install-list-table.php | 15 +++++++++++++-- wp-admin/includes/plugin-install.php | 17 ++++++++++++++--- wp-includes/version.php | 2 +- 3 files changed, 28 insertions(+), 6 deletions(-) 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 bcb2ff6cc7..e1a730610b 100644 --- a/wp-admin/includes/class-wp-plugin-install-list-table.php +++ b/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 ) ) { ?> diff --git a/wp-includes/version.php b/wp-includes/version.php index bcacd678ca..ceb917ec8f 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.2-beta3-31989'; +$wp_version = '4.2-beta3-31990'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.