WordPress.org

Making WordPress.org

Changeset 1293


Ignore:
Timestamp:
02/21/2015 08:30:48 AM (6 years ago)
Author:
Otto42
Message:

W.org themes: Add user nicename and displayname to query response in functions.php, change view-template for theme-single.php to display the author information correctly. #745

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

Legend:

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

    r1278 r1293  
    183183    foreach ( $api->themes as &$theme ) {
    184184        $theme->name           = wp_kses( $theme->name,        $themes_allowedtags );
     185
     186        // add in the nicename for the url, and the displayname for the display
     187        $user = get_user_by('login', $theme->author);
     188        $theme->authorurl      = $user->user_nicename;
     189        $theme->authordispname = wp_kses( $user->display_name, $themes_allowedtags );
     190       
    185191        $theme->author         = wp_kses( $theme->author,      $themes_allowedtags );
    186192        $theme->version        = wp_kses( $theme->version,     $themes_allowedtags );
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/view-templates/theme-single.php

    r1278 r1293  
    1717            <div class="theme-head">
    1818                <h3 class="theme-name entry-title">{{{ data.name }}}</h3>
    19                 <h4 class="theme-author"><?php printf( __( 'By %s' ), '<a href="https://profiles.wordpress.org/{{ data.author }}"><span class="author">{{{ data.author }}}</span></a>' ); ?></h4>
     19                <h4 class="theme-author"><?php printf( __( 'By %s' ), '<a href="https://profiles.wordpress.org/{{ data.authorurl }}"><span class="author">{{{ data.authordispname }}}</span></a>' ); ?></h4>
    2020
    2121                <div class="theme-actions">
Note: See TracChangeset for help on using the changeset viewer.