wpseek.com
WordPress开发者和主题制作者的搜索引擎
get_the_author_posts_link › WordPress Function
Since4.4.0
已弃用n/a
› get_the_author_posts_link ( 没有参数 )
| 返回: |
|
| 定义在: |
|
| 文档: | |
| Change Log: |
|
Retrieves an HTML link to the author page of the current post's author.
Returns an HTML-formatted link using get_author_posts_url().Related Functions: the_author_posts_link, get_the_author_posts, get_the_author_link, get_author_rss_link, get_author_posts_url
源码
function get_the_author_posts_link() {
global $authordata;
if ( ! is_object( $authordata ) ) {
return '';
}
$author = get_the_author();
/* translators: %s: Author's display name. */
$title = sprintf( __( 'Posts by %s' ), $author );
$link = sprintf(
'<a href="%1$s" rel="author">%2$s</a>',
esc_url( get_author_posts_url( $authordata->ID, $authordata->user_nicename ) ),
$author
);
/**
* Filters the link to the author page of the author of the current post.
*
* @since 2.9.0
* @since 7.0.0 Added `$author` and `$title` parameters.
*
* @param string $link HTML link.
* @param string $author Author's display name.
* @param string $title Text originally used for a title attribute.
*/
return apply_filters( 'the_author_posts_link', $link, $author, $title );
}