Making WordPress.org


Ignore:
Timestamp:
11/20/2015 02:04:19 AM (9 years ago)
Author:
dd32
Message:

Themes: Add an Active Installs count for themes.
This counts the number of sites who report as having a theme of the same name active as their current theme.
If a theme is used as a template for another, it's technically active but not included in this count.

The popular tab is now sorted by the number of active installs as well.

See #909

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/theme-single.php

    r1900 r2094  
    3939                <div class="theme-meta-info">
    4040                    <p class="updated"><?php printf( __( 'Last updated: %s', 'wporg-themes' ), '<strong>' . date_i18n( 'F j, Y', strtotime( $theme->last_updated ) ) . '</strong>' ); ?></p>
     41                    <?php
     42                        $active_installs = $theme->active_installs;
     43                        if ( $active_installs < 10 ) {
     44                            $active_installs = __( 'Less than 10', 'wporg-themes' );
     45                        } elseif ( $active_installs >= 1000000 ) {
     46                            $active_installs = __( '1+ million', 'wporg-themes' );
     47                        } else {
     48                            $active_installs = number_format_i18n( $active_installs ) . '+';
     49                        }
     50                    ?>
     51                    <p class="active_installs"><?php printf( __( 'Active Installs: %s', 'wporg-themes' ), '<strong>' . $active_installs . '</strong>' ); ?></p>
    4152                    <?php if ( $theme->theme_url ) { ?>
    4253                    <a href="<?php echo esc_url( $theme->theme_url ); ?>"><?php _e( 'Theme Homepage', 'wporg-themes' ); ?></a>
     
    7283
    7384                <div class="theme-downloads">
    74                     <p class="total-downloads"><?php printf( __( 'Total downloads: %s', 'wporg-themes' ), '<strong>' . number_format_i18n( $theme->downloaded ) . '</strong>' ); ?></p>
    7585                </div><!-- .theme-downloads -->
    7686            </div>
Note: See TracChangeset for help on using the changeset viewer.