Make WordPress Core


Ignore:
Timestamp:
04/02/2015 11:48:26 PM (10 years ago)
Author:
dd32
Message:

Plugins Browser: Replace the download count with the number of Active installs of the plugin.
Fixes #31865

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/plugin-install.php

    r31862 r31990  
    349349        'slug' => wp_unslash( $_REQUEST['plugin'] ),
    350350        'is_ssl' => is_ssl(),
    351         'fields' => array( 'banners' => true, 'reviews' => true )
     351        'fields' => array(
     352            'banners' => true,
     353            'reviews' => true,
     354            'downloaded' => false,
     355            'active_installs' => true
     356        )
    352357    ) );
    353358
     
    459464        <?php } if ( ! empty( $api->tested ) ) { ?>
    460465            <li><strong><?php _e( 'Compatible up to:' ); ?></strong> <?php echo $api->tested; ?></li>
    461         <?php } if ( ! empty( $api->downloaded ) ) { ?>
    462             <li><strong><?php _e( 'Downloaded:' ); ?></strong> <?php printf( _n( '%s time', '%s times', $api->downloaded ), number_format_i18n( $api->downloaded ) ); ?></li>
     466        <?php } if ( ! empty( $api->active_installs ) ) { ?>
     467            <li><strong><?php _e( 'Active Installs:' ); ?></strong> <?php
     468                if ( $api->active_installs >= 1000000 ) {
     469                    _ex( '1+ Million', 'Active plugin installs' );
     470                } else {
     471                    echo number_format_i18n( $api->active_installs ) . '+';
     472                }
     473            ?></li>
    463474        <?php } if ( ! empty( $api->slug ) && empty( $api->external ) ) { ?>
    464475            <li><a target="_blank" href="https://wordpress.org/plugins/<?php echo $api->slug; ?>/"><?php _e( 'WordPress.org Plugin Page &#187;' ); ?></a></li>
Note: See TracChangeset for help on using the changeset viewer.