Ticket #22400: 22400.author-template.php.diff
File 22400.author-template.php.diff, 2.9 KB (added by , 11 years ago) |
---|
-
wp-includes/author-template.php
275 275 ); 276 276 277 277 $args = wp_parse_args( $args, $defaults ); 278 extract( $args, EXTR_SKIP );279 278 280 279 $return = ''; 281 280 … … 290 289 foreach ( $authors as $author_id ) { 291 290 $author = get_userdata( $author_id ); 292 291 293 if ( $ exclude_admin&& 'admin' == $author->display_name )292 if ( $args['exclude_admin'] && 'admin' == $author->display_name ) 294 293 continue; 295 294 296 295 $posts = isset( $author_count[$author->ID] ) ? $author_count[$author->ID] : 0; 297 296 298 if ( !$posts && $ hide_empty)297 if ( !$posts && $args['hide_empty'] ) 299 298 continue; 300 299 301 300 $link = ''; 302 301 303 if ( $ show_fullname&& $author->first_name && $author->last_name )302 if ( $args['show_fullname'] && $author->first_name && $author->last_name ) 304 303 $name = "$author->first_name $author->last_name"; 305 304 else 306 305 $name = $author->display_name; 307 306 308 if ( !$ html) {307 if ( !$args['html'] ) { 309 308 $return .= $name . ', '; 310 309 311 310 continue; // No need to go further to process HTML. 312 311 } 313 312 314 if ( 'list' == $ style) {313 if ( 'list' == $args['style'] ) { 315 314 $return .= '<li>'; 316 315 } 317 316 318 317 $link = '<a href="' . get_author_posts_url( $author->ID, $author->user_nicename ) . '" title="' . esc_attr( sprintf(__("Posts by %s"), $author->display_name) ) . '">' . $name . '</a>'; 319 318 320 if ( !empty( $ feed_image ) || !empty( $feed) ) {319 if ( !empty( $args['feed_image'] ) || !empty( $args['feed'] ) ) { 321 320 $link .= ' '; 322 if ( empty( $ feed_image) ) {321 if ( empty( $args['feed_image'] ) ) { 323 322 $link .= '('; 324 323 } 325 324 326 325 $link .= '<a href="' . get_author_feed_link( $author->ID ) . '"'; 327 326 328 327 $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']; 333 332 $link .= $title; 334 333 } 335 334 336 335 $link .= '>'; 337 336 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 . ' />'; 340 339 else 341 340 $link .= $name; 342 341 343 342 $link .= '</a>'; 344 343 345 if ( empty( $ feed_image) )344 if ( empty( $args['feed_image'] ) ) 346 345 $link .= ')'; 347 346 } 348 347 349 if ( $ optioncount)348 if ( $args['optioncount'] ) 350 349 $link .= ' ('. $posts . ')'; 351 350 352 351 $return .= $link; 353 $return .= ( 'list' == $ style) ? '</li>' : ', ';352 $return .= ( 'list' == $args['style'] ) ? '</li>' : ', '; 354 353 } 355 354 356 355 $return = rtrim($return, ', '); 357 356 358 if ( !$ echo)357 if ( !$args['echo'] ) 359 358 return $return; 360 359 361 360 echo $return;