From dddfbdfc5f429288be82265b636cc5c280c2dd85 Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Wed, 7 Apr 2010 12:26:28 +0000 Subject: [PATCH] get_the_author_link(). props zoranzaric. fixes #12892 git-svn-id: https://develop.svn.wordpress.org/trunk@14028 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/author-template.php | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/wp-includes/author-template.php b/wp-includes/author-template.php index 9d6bedc1c3..703576618d 100644 --- a/wp-includes/author-template.php +++ b/wp-includes/author-template.php @@ -127,6 +127,23 @@ function the_author_meta($field = '', $user_id = false) { echo apply_filters('the_author_' . $field, get_the_author_meta($field, $user_id), $user_id); } +/** + * Retrieve either author's link or author's name. + * + * If the author has a home page set, return an HTML link, otherwise just return the + * author's name. + * + * @uses get_the_author_meta() + * @uses get_the_author() + */ +function get_the_author_link() { + if ( get_the_author_meta('url') ) { + return '' . get_the_author() . ''; + } else { + return get_the_author(); + } +} + /** * Display either author's link or author's name. * @@ -135,15 +152,10 @@ function the_author_meta($field = '', $user_id = false) { * * @link http://codex.wordpress.org/Template_Tags/the_author_link * @since 2.1 - * @uses get_the_author_meta() - * @uses the_author() + * @uses get_the_author_link() */ function the_author_link() { - if ( get_the_author_meta('url') ) { - echo '' . get_the_author() . ''; - } else { - the_author(); - } + echo get_the_author_link(); } /**