get_the_author_posts_link() - WordPress 函数参考中文文档

返回介绍

get_the_author_posts_link()

发布于 2017-09-11 字数 2009 浏览 928 评论 0

get_the_author_posts_link()

Retrieves an HTML link to the author page of the current post’s author.


描述

Returns an HTML-formatted link using get_author_posts_url().


返回值

(string) An HTML link to the author page.


源代码

File: wp-includes/author-template.php

function get_the_author_posts_link() {
	global $authordata;
	if ( ! is_object( $authordata ) ) {
		return;
	}

	$link = sprintf( '<a href="%1$s" title="%2$s" rel="author">%3$s</a>',
		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 );
}

更新日志

Version 描述
4.4.0 Introduced.

相关函数

Uses

  • wp-includes/l10n.php:
    __()
  • wp-includes/formatting.php:
    esc_url()
  • wp-includes/formatting.php:
    esc_attr()
  • wp-includes/plugin.php:
    apply_filters()
  • wp-includes/author-template.php:
    get_author_posts_url()
  • wp-includes/author-template.php:
    the_author_posts_link
  • wp-includes/author-template.php:
    get_the_author()
  • Show 2 more uses
    Hide more uses


Used By

  • wp-includes/author-template.php:
    the_author_posts_link()

User Contributed Notes

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!