Make WordPress Core

Ticket #14408: author-template-patch.diff

File author-template-patch.diff, 3.4 KB (added by garyc40, 14 years ago)
  • wp-includes/author-template.php

    Property changes on: .
    ___________________________________________________________________
    Added: svn:ignore
       + wp-config.php
    
    
     
    109109                $value = isset($authordata->ID) ? (int)$authordata->ID : 0;
    110110        elseif ( isset($authordata->$user_field) )
    111111                $value = $authordata->$user_field;
     112        elseif ( 'display_name' == $field )
     113                $value = isset( $authordata->display_name ) ? apply_filters( 'the_author', $authordata->display_name ) : null;
    112114        else
    113115                $value = isset($authordata->$field) ? $authordata->$field : '';
    114116
  • wp-content/themes/twentyten/author.php

     
    1313                        <div id="content" role="main">
    1414
    1515<?php
    16         /* Queue the first post, that way we know who
    17          * the author is when we try to get their name,
    18          * URL, description, avatar, etc.
    19          *
    20          * We reset this later so we can run the loop
    21          * properly with a call to rewind_posts().
    22          */
    23         if ( have_posts() )
    24                 the_post();
     16        // Get the author ID based on the supplied query variable
     17        $author_id = get_query_var( 'author' );         
    2518?>
    2619
    27                                 <h1 class="page-title author"><?php printf( __( 'Author Archives: %s', 'twentyten' ), "<span class='vcard'><a class='url fn n' href='" . get_author_posts_url( get_the_author_meta( 'ID' ) ) . "' title='" . esc_attr( get_the_author() ) . "' rel='me'>" . get_the_author() . "</a></span>" ); ?></h1>
     20                                <h1 class="page-title author"><?php printf( __( 'Author Archives: %s', 'twentyten' ), "<span class='vcard'><a class='url fn n' href='" . get_author_posts_url( $author_id ) . "' title='" . esc_attr( get_the_author_meta( 'display_name', $author_id ) ) . "' rel='me'>" . get_the_author_meta( 'display_name', $author_id ) . "</a></span>" ); ?></h1>
    2821
    2922<?php
    3023// If a user has filled out their description, show a bio on their entries.
    31 if ( get_the_author_meta( 'description' ) ) : ?>
     24if ( get_the_author_meta( 'description', $author_id ) ) : ?>
    3225                                        <div id="entry-author-info">
    3326                                                <div id="author-avatar">
    34                                                         <?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyten_author_bio_avatar_size', 60 ) ); ?>
     27                                                        <?php echo get_avatar( get_the_author_meta( 'user_email', $author_id ), apply_filters( 'twentyten_author_bio_avatar_size', 60 ) ); ?>
    3528                                                </div><!-- #author-avatar -->
    3629                                                <div id="author-description">
    37                                                         <h2><?php printf( __( 'About %s', 'twentyten' ), get_the_author() ); ?></h2>
    38                                                         <?php the_author_meta( 'description' ); ?>
     30                                                        <h2><?php printf( __( 'About %s', 'twentyten' ), get_the_author_meta( 'display_name', $author_id ) ); ?></h2>
     31                                                        <?php the_author_meta( 'description', $author_id ); ?>
    3932                                                </div><!-- #author-description  -->
    4033                                        </div><!-- #entry-author-info -->
    4134<?php endif; ?>
    4235
    4336<?php
    44         /* Since we called the_post() above, we need to
    45          * rewind the loop back to the beginning that way
    46          * we can run the loop properly, in full.
    47          */
    48         rewind_posts();
    49 
    5037        /* Run the loop for the author archive page to output the authors posts
    5138         * If you want to overload this in a child theme then include a file
    5239         * called loop-author.php and that will be used instead.