Make WordPress Core

Ticket #22400: 22400.author-template.php.diff

File 22400.author-template.php.diff, 2.9 KB (added by MikeHansenMe, 11 years ago)

author-template.php

  • wp-includes/author-template.php

     
    275275        );
    276276
    277277        $args = wp_parse_args( $args, $defaults );
    278         extract( $args, EXTR_SKIP );
    279278
    280279        $return = '';
    281280
     
    290289        foreach ( $authors as $author_id ) {
    291290                $author = get_userdata( $author_id );
    292291
    293                 if ( $exclude_admin && 'admin' == $author->display_name )
     292                if ( $args['exclude_admin'] && 'admin' == $author->display_name )
    294293                        continue;
    295294
    296295                $posts = isset( $author_count[$author->ID] ) ? $author_count[$author->ID] : 0;
    297296
    298                 if ( !$posts && $hide_empty )
     297                if ( !$posts && $args['hide_empty'] )
    299298                        continue;
    300299
    301300                $link = '';
    302301
    303                 if ( $show_fullname && $author->first_name && $author->last_name )
     302                if ( $args['show_fullname'] && $author->first_name && $author->last_name )
    304303                        $name = "$author->first_name $author->last_name";
    305304                else
    306305                        $name = $author->display_name;
    307306
    308                 if ( !$html ) {
     307                if ( !$args['html'] ) {
    309308                        $return .= $name . ', ';
    310309
    311310                        continue; // No need to go further to process HTML.
    312311                }
    313312
    314                 if ( 'list' == $style ) {
     313                if ( 'list' == $args['style'] ) {
    315314                        $return .= '<li>';
    316315                }
    317316
    318317                $link = '<a href="' . get_author_posts_url( $author->ID, $author->user_nicename ) . '" title="' . esc_attr( sprintf(__("Posts by %s"), $author->display_name) ) . '">' . $name . '</a>';
    319318
    320                 if ( !empty( $feed_image ) || !empty( $feed ) ) {
     319                if ( !empty( $args['feed_image'] ) || !empty( $args['feed'] ) ) {
    321320                        $link .= ' ';
    322                         if ( empty( $feed_image ) ) {
     321                        if ( empty( $args['feed_image'] ) ) {
    323322                                $link .= '(';
    324323                        }
    325324
    326325                        $link .= '<a href="' . get_author_feed_link( $author->ID ) . '"';
    327326
    328327                        $alt = $title = '';
    329                         if ( !empty( $feed ) ) {
    330                                 $title = ' title="' . esc_attr( $feed ) . '"';
    331                                 $alt = ' alt="' . esc_attr( $feed ) . '"';
    332                                 $name = $feed;
     328                        if ( !empty( $args['feed'] ) ) {
     329                                $title = ' title="' . esc_attr( $args['feed'] ) . '"';
     330                                $alt = ' alt="' . esc_attr( $args['feed'] ) . '"';
     331                                $name = $args['feed'];
    333332                                $link .= $title;
    334333                        }
    335334
    336335                        $link .= '>';
    337336
    338                         if ( !empty( $feed_image ) )
    339                                 $link .= '<img src="' . esc_url( $feed_image ) . '" style="border: none;"' . $alt . $title . ' />';
     337                        if ( !empty( $args['feed_image'] ) )
     338                                $link .= '<img src="' . esc_url( $args['feed_image'] ) . '" style="border: none;"' . $alt . $title . ' />';
    340339                        else
    341340                                $link .= $name;
    342341
    343342                        $link .= '</a>';
    344343
    345                         if ( empty( $feed_image ) )
     344                        if ( empty( $args['feed_image'] ) )
    346345                                $link .= ')';
    347346                }
    348347
    349                 if ( $optioncount )
     348                if ( $args['optioncount'] )
    350349                        $link .= ' ('. $posts . ')';
    351350
    352351                $return .= $link;
    353                 $return .= ( 'list' == $style ) ? '</li>' : ', ';
     352                $return .= ( 'list' == $args['style'] ) ? '</li>' : ', ';
    354353        }
    355354
    356355        $return = rtrim($return, ', ');
    357356
    358         if ( !$echo )
     357        if ( !$args['echo'] )
    359358                return $return;
    360359
    361360        echo $return;