Skip to content

Commit 67d619b

Browse files
author
pento
committed
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
1 parent cfe3528 commit 67d619b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

wp-includes/author-template.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,12 +288,12 @@ function the_author_posts() {
288288
*
289289
* @global object $authordata The current author's DB object.
290290
*
291-
* @return string An HTML link to the author page.
291+
* @return string An HTML link to the author page, or an empty string if $authordata isn't defined.
292292
*/
293293
function get_the_author_posts_link() {
294294
global $authordata;
295295
if ( ! is_object( $authordata ) ) {
296-
return;
296+
return '';
297297
}
298298

299299
$link = sprintf(

wp-includes/version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*
1414
* @global string $wp_version
1515
*/
16-
$wp_version = '5.1-beta1-44615';
16+
$wp_version = '5.1-beta1-44616';
1717

1818
/**
1919
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

0 commit comments

Comments
 (0)