Plugins: Add support for plugins having an active_installs value larger than 1 million.

WordPress.org currently supports up to 5 million, and with the growth of WordPress, it's expected that that upper bound will increase in the future.

Fixes #43193.


git-svn-id: https://develop.svn.wordpress.org/trunk@42829 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse 2018-03-12 01:56:20 +00:00
parent 1e54b5a2ae
commit 36d237cc13
2 changed files with 10 additions and 2 deletions

View File

@ -650,7 +650,11 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
<div class="column-downloaded">
<?php
if ( $plugin['active_installs'] >= 1000000 ) {
$active_installs_text = _x( '1+ Million', 'Active plugin installations' );
$active_installs_millions = floor( $plugin['active_installs'] / 1000000 );
$active_installs_text = sprintf(
_nx( '%s+ Million', '%s+ Million', 'Active plugin installations', $active_installs_millions ),
number_format_i18n( $active_installs_millions )
);
} elseif ( 0 == $plugin['active_installs'] ) {
$active_installs_text = _x( 'Less Than 10', 'Active plugin installations' );
} else {

View File

@ -652,7 +652,11 @@ function install_plugin_information() {
<li><strong><?php _e( 'Active Installations:' ); ?></strong>
<?php
if ( $api->active_installs >= 1000000 ) {
_ex( '1+ Million', 'Active plugin installations' );
$active_installs_millions = floor( $api->active_installs / 1000000 );
printf(
_nx( '%s+ Million', '%s+ Million', 'Active plugin installations', $active_installs_millions ),
number_format_i18n( $active_installs_millions )
);
} elseif ( 0 == $api->active_installs ) {
_ex( 'Less Than 10', 'Active plugin installations' );
} else {