mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
If the `$authordata` global is not set, `get_the_author()` returned `null`, causing a PHP 8.1 "null to non-nullable" deprecation notice in `ent2ncr()` hooked via `the_author` filter:
{{{
str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
}}}
This commit updates `get_the_author()` to return an empty string if called before `$authordata` is set, bringing consistency with a few other similar functions which also return an empty string in this case:
* `get_the_author_meta()`
* `get_the_author_posts_link()`
* `get_the_modified_author()`
Follow-up to [695/tests], [2858], [11138], [12284], [20575], [34677], [44616], [53187].
Props Soean, jrf, sabernhardt, salvoaranzulla, antpb, ebai4, sajjad67, tijmensmit, SergeyBiryukov.
Fixes #58157.
git-svn-id: https://develop.svn.wordpress.org/trunk@55755 602fd350-edb4-49c9-b593-d223f7449a82
|
||
|---|---|---|
| .. | ||
| capabilities.php | ||
| countUserPosts.php | ||
| countUsers.php | ||
| dateQuery.php | ||
| getActiveBlogForUser.php | ||
| getTheAuthor.php | ||
| getTheAuthorLink.php | ||
| getTheAuthorMeta.php | ||
| getTheAuthorPosts.php | ||
| getTheAuthorPostsLink.php | ||
| getTheModifiedAuthor.php | ||
| getUserCount.php | ||
| mapMetaCap.php | ||
| multisite.php | ||
| passwordHash.php | ||
| query.php | ||
| queryCache.php | ||
| retrievePassword.php | ||
| session.php | ||
| slashes.php | ||
| updateUserCaches.php | ||
| wpAuthenticateSpamCheck.php | ||
| wpDeleteUser.php | ||
| wpDropdownUsers.php | ||
| wpGetUsersWithNoRole.php | ||
| wpListAuthors.php | ||
| wpListUsers.php | ||
| wpRegisterPersistedPreferencesMeta.php | ||
| wpSendUserRequest.php | ||
| wpSetCurrentUser.php | ||