From ff1eabd7e198f05c0a181bd13a37960e2a660e90 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Thu, 21 May 2015 20:09:44 +0000 Subject: [PATCH] In `author-template.php`, clarify/add some `return` docs. See #32444. git-svn-id: https://develop.svn.wordpress.org/trunk@32526 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/author-template.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/wp-includes/author-template.php b/src/wp-includes/author-template.php index 2e520f5424..4cc514ee00 100644 --- a/src/wp-includes/author-template.php +++ b/src/wp-includes/author-template.php @@ -18,7 +18,7 @@ * @uses $authordata The current author's DB object. * * @param string $deprecated Deprecated. - * @return string The author's display name. + * @return string|null The author's display name. */ function get_the_author($deprecated = '') { global $authordata; @@ -53,7 +53,7 @@ function get_the_author($deprecated = '') { * * @param string $deprecated Deprecated. * @param string $deprecated_echo Deprecated. Use get_the_author(). Echo the string or return it. - * @return string The author's display name, from get_the_author(). + * @return string|null The author's display name, from get_the_author(). */ function the_author( $deprecated = '', $deprecated_echo = true ) { if ( !empty( $deprecated ) ) @@ -70,7 +70,7 @@ function the_author( $deprecated = '', $deprecated_echo = true ) { * * @since 2.8.0 * - * @return string The author's display name. + * @return string|null The author's display name. */ function get_the_modified_author() { if ( $last_id = get_post_meta( get_post()->ID, '_edit_last', true) ) { @@ -88,12 +88,12 @@ function get_the_modified_author() { } /** - * Display the name of the author who last edited the current post. + * Display the name of the author who last edited the current post, + * if the author's ID is available. * * @since 2.8.0 * * @see get_the_author() - * @return string The author's display name, from get_the_modified_author(). */ function the_modified_author() { echo get_the_modified_author(); @@ -162,6 +162,9 @@ function the_author_meta( $field = '', $user_id = false ) { * * If the author has a home page set, return an HTML link, otherwise just return the * author's name. + * + * @return string|null An HTML link if the author's url exist in user meta, + * else the result of get_the_author(). */ function get_the_author_link() { if ( get_the_author_meta('url') ) { @@ -220,6 +223,8 @@ function the_author_posts() { * @link https://codex.wordpress.org/Template_Tags/the_author_posts_link * @since 1.2.0 * @param string $deprecated Deprecated. + * + * @return false|null */ function the_author_posts_link($deprecated = '') { if ( !empty( $deprecated ) )