WordPress.org

Making WordPress.org

Changeset 1383


Ignore:
Timestamp:
03/06/2015 08:45:23 AM (4 years ago)
Author:
obenland
Message:

WP.org Themes: Add last_updated and theme_url to single themes.

Is in need of a design upgrade.

See #908, #953.

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

Legend:

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

    r1361 r1383  
    3131            </div>
    3232            <?php endif; ?>
     33
     34            <div class="theme-meta-info">
     35                <p class="updated"><?php printf( __( 'Last updated: %s', 'wporg-themes' ), '<strong>' . date_i18n( get_option( 'date_format' ), strtotime( $theme->last_updated ) ) . '</strong>' ); ?></p>
     36                <?php
     37                    $theme_url = wporg_themes_get_version_meta( get_the_ID(), '_theme_url', $theme->version );
     38                    if ( ! empty( $theme_url ) ) :
     39                ?>
     40                <a href="<?php echo esc_url( $theme_url ); ?>"><?php _e( 'Theme Homepage', 'wporg-themes' ); ?></a>
     41                <?php endif; ?>
     42            </div>
    3343        </div><!-- .theme-head -->
    3444
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/functions.php

    r1375 r1383  
    3939    wp_enqueue_style( 'ratings', '//wordpress.org/extend/themes-plugins/bb-ratings/bb-ratings.css', array(), '4' );
    4040    wp_enqueue_style( 'themes-style', self_admin_url( 'css/themes.css' ) );
    41     wp_enqueue_style( 'wporg-themes-style', get_stylesheet_uri() );
     41    wp_enqueue_style( 'wporg-themes-style', get_stylesheet_uri(), array(), filemtime( __DIR__ . '/style.css' ) );
    4242
    4343    wp_enqueue_script( 'google-jsapi', '//www.google.com/jsapi', array( 'jquery' ), null );
     
    136136        'num_ratings'  => true,
    137137        'parent'       => true,
     138        'theme_url'    => true,
    138139    ) );
    139140
     
    173174    if ( in_array( $action, array( 'query_themes', 'theme_information' ) ) ) {
    174175        $args->per_page = 30;
    175         $args->fields['parent']  = true;
    176         $args->fields['ratings'] = true;
    177         $args->fields['tags']    = true;
     176        $args->fields['parent']    = true;
     177        $args->fields['ratings']   = true;
     178        $args->fields['tags']      = true;
     179        $args->fields['theme_url'] = true;
    178180    }
    179181
     
    209211        'num_ratings'  => true,
    210212        'parent'       => true,
     213        'theme_url'    => true,
    211214    ) );
    212215    $args = wp_parse_args( $request, array(
     
    247250        'num_ratings'  => true,
    248251        'parent'       => true,
     252        'theme_url'    => true,
    249253    ) );
    250254
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/style.css

    r1377 r1383  
    177177}
    178178
     179.theme-wrap .theme-meta-info {
     180    margin: 1.5em 0 0;
     181}
     182
     183.theme-wrap .theme-meta-info .updated {
     184    margin: 0 0 0.5em;
     185}
     186
     187.theme-wrap .theme-meta-info a:after {
     188    content: '\2192';
     189    margin-left: 5px;
     190}
     191
    179192.theme-overlay .theme-description,
    180193.theme-overlay .theme-tags {
     
    184197
    185198.theme-wrap .theme-devs,
    186 .theme-wrap .theme-support {
     199.theme-wrap .theme-support,
     200.theme-wrap .theme-meta-info {
    187201    font-size: 1.4em;
    188202}
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/view-templates/theme-single.php

    r1377 r1383  
    2929                </div>
    3030                <# } #>
     31
     32                <div class="theme-meta-info">
     33                    <p class="updated"><?php printf( __( 'Last updated: %s', 'wporg-themes' ), '<strong>{{ new Date( data.last_updated ).toLocaleDateString() }}</strong>' ); ?></p>
     34                    <# if ( data.theme_url ) { #>
     35                    <a href="{{ data.theme_url }}"><?php _e( 'Theme Homepage', 'wporg-themes' ); ?></a>
     36                    <# } #>
     37                </div>
    3138            </div><!-- .theme-head -->
    3239
Note: See TracChangeset for help on using the changeset viewer.