Make WordPress Core

Ticket #58157: 58157.diff

File 58157.diff, 1.9 KB (added by SergeyBiryukov, 12 months ago)
  • src/wp-includes/author-template.php

     
    1414 * Retrieves the author of the current post.
    1515 *
    1616 * @since 1.5.0
     17 * @since 6.3.0 Returns an empty string if the author's display name is unknown.
    1718 *
    1819 * @global WP_User $authordata The current author's data.
    1920 *
    2021 * @param string $deprecated Deprecated.
    21  * @return string|null The author's display name.
     22 * @return string The author's display name, empty string if unknown.
    2223 */
    2324function get_the_author( $deprecated = '' ) {
    2425        global $authordata;
     
    3233         *
    3334         * @since 2.9.0
    3435         *
    35          * @param string|null $display_name The author's display name.
     36         * @param string $display_name The author's display name.
    3637         */
    37         return apply_filters( 'the_author', is_object( $authordata ) ? $authordata->display_name : null );
     38        return apply_filters( 'the_author', is_object( $authordata ) ? $authordata->display_name : '' );
    3839}
    3940
    4041/**
     
    5556 *
    5657 * @param string $deprecated      Deprecated.
    5758 * @param bool   $deprecated_echo Deprecated. Use get_the_author(). Echo the string or return it.
    58  * @return string|null The author's display name, from get_the_author().
     59 * @return string The author's display name, from get_the_author().
    5960 */
    6061function the_author( $deprecated = '', $deprecated_echo = true ) {
    6162        if ( ! empty( $deprecated ) ) {
     
    226227 *
    227228 * @global WP_User $authordata The current author's data.
    228229 *
    229  * @return string|null An HTML link if the author's url exist in user meta,
    230  *                     else the result of get_the_author().
     230 * @return string An HTML link if the author's url exist in user meta,
     231 *                else the result of get_the_author().
    231232 */
    232233function get_the_author_link() {
    233234        if ( get_the_author_meta( 'url' ) ) {