函数
get_the_author_posts_link ( No parameters )
- 返回值
-
- (string) An HTML link to the author page, or an empty string if $authordata isn’t defined.
- 定义位置
-
-
wp-includes/author-template.php
, line 312
-
wp-includes/author-template.php
- 引入
- 4.4.0
- 弃用
- –
Retrieves an HTML link to the author page of the current post’s author.
Returns an HTML-formatted link using get_author_posts_url().
function get_the_author_posts_link() { global $authordata; if ( ! is_object( $authordata ) ) { return ''; } $link = sprintf( '%3$s', esc_url( get_author_posts_url( $authordata->ID, $authordata->user_nicename ) ), /* translators: %s: Author's display name. */ esc_attr( sprintf( __( 'Posts by %s' ), get_the_author() ) ), get_the_author() ); /** * Filters the link to the author page of the author of the current post. * * @since 2.9.0 * * @param string $link HTML link. */ return apply_filters( 'the_author_posts_link', $link ); }
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。