get_the_author_posts_link
Retrieves an HTML link to the author page of the current post's author.
Description
(string) get_the_author_posts_link();
Returns an HTML-formatted link using get_author_posts_url(…)
.
Returns (string)
An HTML link to the author page.
Usage
if ( !function_exists( 'get_the_author_posts_link' ) ) { require_once ABSPATH . WPINC . '/author-template.php'; } // NOTICE! Understand what this does before running. $result = get_the_author_posts_link();
Defined (1)
The function is defined in the following location(s).
- /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 */
- );
- /**
- * 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 );
- }