Make WordPress Core

Changeset 44616


Ignore:
Timestamp:
01/16/2019 05:53:26 AM (6 years ago)
Author:
pento
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/author-template.php

    r44503 r44616  
    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 */
    293293function get_the_author_posts_link() {
    294294    global $authordata;
    295295    if ( ! is_object( $authordata ) ) {
    296         return;
     296        return '';
    297297    }
    298298
Note: See TracChangeset for help on using the changeset viewer.