Make WordPress Core


Ignore:
Timestamp:
04/07/2010 12:26:28 PM (15 years ago)
Author:
markjaquith
Message:

get_the_author_link(). props zoranzaric. fixes #12892

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/author-template.php

    r13989 r14028  
    129129
    130130/**
     131 * Retrieve either author's link or author's name.
     132 *
     133 * If the author has a home page set, return an HTML link, otherwise just return the
     134 * author's name.
     135 *
     136 * @uses get_the_author_meta()
     137 * @uses get_the_author()
     138 */
     139function get_the_author_link() {
     140    if ( get_the_author_meta('url') ) {
     141        return '<a href="' . get_the_author_meta('url') . '" title="' . esc_attr( sprintf(__("Visit %s&#8217;s website"), get_the_author()) ) . '" rel="external">' . get_the_author() . '</a>';
     142    } else {
     143        return get_the_author();
     144    }
     145}
     146
     147/**
    131148 * Display either author's link or author's name.
    132149 *
     
    136153 * @link http://codex.wordpress.org/Template_Tags/the_author_link
    137154 * @since 2.1
    138  * @uses get_the_author_meta()
    139  * @uses the_author()
     155 * @uses get_the_author_link()
    140156 */
    141157function the_author_link() {
    142     if ( get_the_author_meta('url') ) {
    143         echo '<a href="' . get_the_author_meta('url') . '" title="' . esc_attr( sprintf(__("Visit %s&#8217;s website"), get_the_author()) ) . '" rel="external">' . get_the_author() . '</a>';
    144     } else {
    145         the_author();
    146     }
     158    echo get_the_author_link();
    147159}
    148160
Note: See TracChangeset for help on using the changeset viewer.