From 32ace06a392ab45264ed9c5de052d3e5f7198597 Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Wed, 16 Jan 2019 05:54:49 +0000 Subject: [PATCH] Templates: Fix the return value of `get_the_author_posts_link()`. When the `$authordata` global isn't defined, return an empty string, rather than `void`. Props mukesh27, subrataemfluence. Fixes #45597. Built from https://develop.svn.wordpress.org/trunk@44616 git-svn-id: http://core.svn.wordpress.org/trunk@44447 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/author-template.php | 4 ++-- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/author-template.php b/wp-includes/author-template.php index b73d84dadc..210ed68137 100644 --- a/wp-includes/author-template.php +++ b/wp-includes/author-template.php @@ -288,12 +288,12 @@ function the_author_posts() { * * @global object $authordata The current author's DB object. * - * @return string An HTML link to the author page. + * @return string An HTML link to the author page, or an empty string if $authordata isn't defined. */ function get_the_author_posts_link() { global $authordata; if ( ! is_object( $authordata ) ) { - return; + return ''; } $link = sprintf( diff --git a/wp-includes/version.php b/wp-includes/version.php index efde8b40fe..4f8865346b 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.1-beta1-44615'; +$wp_version = '5.1-beta1-44616'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.