Ticket #39844: author-template.php.patch
File author-template.php.patch, 1.7 KB (added by , 8 years ago) |
---|
-
author-template.php
243 243 /** 244 244 * Retrieves an HTML link to the author page of the current post's author. 245 245 * 246 * Returns an HTML-formatted link using get_author_posts_url() .246 * Returns an HTML-formatted link using get_author_posts_url() or the author name if the link is empty. 247 247 * 248 248 * @since 4.4.0 249 249 * 250 250 * @global object $authordata The current author's DB object. 251 251 * 252 * @return string An HTML link to the author page .252 * @return string An HTML link to the author page or the author name. 253 253 */ 254 254 function get_the_author_posts_link() { 255 255 global $authordata; … … 257 257 return; 258 258 } 259 259 260 $link = sprintf( '<a href="%1$s" title="%2$s" rel="author">%3$s</a>', 261 esc_url( get_author_posts_url( $authordata->ID, $authordata->user_nicename ) ), 262 /* translators: %s: author's display name */ 263 esc_attr( sprintf( __( 'Posts by %s' ), get_the_author() ) ), 264 get_the_author() 265 ); 260 $author = get_the_author(); 261 $url = esc_url( get_author_posts_url( $authordata->ID, $authordata->user_nicename ) ); 266 262 263 if ( empty( $url ) || 'http://' == $url ) 264 $return = $author; 265 else 266 $return = sprintf( '<a href="%1$s" title="%2$s" rel="author">%3$s</a>', 267 $link, 268 /* translators: %s: author's display name */ 269 esc_attr( sprintf( __( 'Posts by %s' ), $author ) ), 270 $author 271 ); 272 267 273 /** 268 274 * Filters the link to the author page of the author of the current post. 269 275 * … … 271 277 * 272 278 * @param string $link HTML link. 273 279 */ 274 return apply_filters( 'the_author_posts_link', $ link);280 return apply_filters( 'the_author_posts_link', $return ); 275 281 } 276 282 277 283 /**