WordPress.org

Make WordPress Core

Ticket #30355: get_author_posts_link.diff

File get_author_posts_link.diff, 1.8 KB (added by chipbennett, 5 years ago)
  • author-template.php

     
    211211}
    212212
    213213/**
    214  * Display an HTML link to the author page of the author of the current post.
     214 * Get an HTML link to the author page of the author of the current post.
    215215 *
    216  * Does just echo get_author_posts_url() function, like the others do. The
    217  * reason for this, is that another function is used to help in printing the
    218  * link to the author's posts.
     216 * Returns an HTML-formatted link using get_author_posts_url().
    219217 *
    220  * @link http://codex.wordpress.org/Template_Tags/the_author_posts_link
    221  * @since 1.2.0
     218 * @link http://codex.wordpress.org/Template_Tags/get_author_posts_link
     219 * @since 4.1.0
    222220 * @param string $deprecated Deprecated.
    223221 */
    224 function the_author_posts_link($deprecated = '') {
     222function get_author_posts_link($deprecated = '') {
    225223        if ( !empty( $deprecated ) )
    226224                _deprecated_argument( __FUNCTION__, '2.1' );
    227225
    228226        global $authordata;
    229         if ( !is_object( $authordata ) )
     227        if ( ! is_object( $authordata ) )
    230228                return false;
    231229        $link = sprintf(
    232230                '<a href="%1$s" title="%2$s" rel="author">%3$s</a>',
     
    242240         *
    243241         * @param string $link HTML link.
    244242         */
    245         echo apply_filters( 'the_author_posts_link', $link );
     243        return apply_filters( 'the_author_posts_link', $link );
    246244}
    247245
     246
    248247/**
     248 * Get an HTML link to the author page of the author of the current post.
     249 *
     250 * Echoes get_author_posts_link() function.
     251 *
     252 * @link http://codex.wordpress.org/Template_Tags/the_author_posts_link
     253 * @since 1.2.0
     254 * @param string $deprecated Deprecated.
     255 */
     256function the_author_posts_link() {
     257        echo get_author_posts_link();
     258}
     259
     260/**
    249261 * Retrieve the URL to the author page for the user with the ID provided.
    250262 *
    251263 * @since 2.1.0