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. git-svn-id: https://develop.svn.wordpress.org/trunk@44616 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
97c6a43eda
commit
cd7d022ae0
@ -288,12 +288,12 @@ function the_author_posts() {
|
|||||||
*
|
*
|
||||||
* @global object $authordata The current author's DB object.
|
* @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() {
|
function get_the_author_posts_link() {
|
||||||
global $authordata;
|
global $authordata;
|
||||||
if ( ! is_object( $authordata ) ) {
|
if ( ! is_object( $authordata ) ) {
|
||||||
return;
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$link = sprintf(
|
$link = sprintf(
|
||||||
|
Loading…
Reference in New Issue
Block a user