Making WordPress.org

Changeset 1278


Ignore:
Timestamp:
02/18/2015 06:30:58 PM (9 years ago)
Author:
obenland
Message:

WP.org Themes: Consistent number formatting across browsers for download counts.

Filters the data coming in from the API, rather than manipulating it on the
front-end.

Fixes #846.

Location:
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes
Files:
3 edited

Legend:

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

    r1274 r1278  
    9393                    }
    9494                </script>
    95                 <p class="total-downloads"><?php printf( __( 'Total downloads: %s' ), '<strong>' . number_format_i18n( $theme->downloaded ) . '</strong>' ); ?></p>
     95                <p class="total-downloads"><?php printf( __( 'Total downloads: %s' ), '<strong>' . $theme->downloaded . '</strong>' ); ?></p>
    9696            </div><!-- .theme-downloads -->
    9797        </div><!-- .theme-info -->
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/functions.php

    r1274 r1278  
    186186        $theme->version        = wp_kses( $theme->version,     $themes_allowedtags );
    187187        $theme->description    = wp_kses( $theme->description, $themes_allowedtags );
     188        $theme->downloaded     = number_format_i18n( $theme->downloaded );
    188189        $theme->num_ratings    = number_format_i18n( $theme->num_ratings );
    189190        $theme->preview_url    = set_url_scheme( $theme->preview_url );
     
    210211    $theme->version        = wp_kses( $theme->version,     $themes_allowedtags );
    211212    $theme->description    = wp_kses( $theme->description, $themes_allowedtags );
     213    $theme->downloaded     = number_format_i18n( $theme->downloaded );
    212214    $theme->num_ratings    = number_format_i18n( $theme->num_ratings );
    213215    $theme->preview_url    = set_url_scheme( $theme->preview_url );
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/view-templates/theme-single.php

    r1273 r1278  
    5050                    <h4><?php _e( 'Downloads Per Day' ); ?></h4>
    5151                    <div id="theme-download-stats-{{data.id}}" class="chart"></div>
    52                     <p class="total-downloads"><?php printf( __( 'Total downloads: %s' ), '<strong>{{ new Number(data.downloaded).toLocaleString() }}</strong>' ); ?></p>
     52                    <p class="total-downloads"><?php printf( __( 'Total downloads: %s' ), '<strong>{{ data.downloaded }}</strong>' ); ?></p>
    5353                </div><!-- .theme-downloads -->
    5454            </div>
Note: See TracChangeset for help on using the changeset viewer.