wordpress-develop/tests
Sergey Biryukov fdd333fa47 Code Modernization: Correct fallback return value in get_the_author().
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
2023-05-14 17:56:26 +00:00
..
e2e Update the WP packages with fixes prior to WP 6.2 beta 3 2023-02-21 13:06:33 +00:00
gutenberg Block Editor: Update the Gutenberg branch used to launch Gutenberg e2e tests. 2021-06-01 09:21:36 +00:00
performance Build/Test Tools: Add a performance measurement workflow. 2023-03-03 20:37:10 +00:00
phpunit Code Modernization: Correct fallback return value in get_the_author(). 2023-05-14 17:56:26 +00:00
qunit REST API: Support non-Latin characters in template route regex. 2023-02-07 23:45:18 +00:00
visual-regression Build/Test Tools: Update some NPM dependencies to the latest versions. 2022-04-08 20:05:03 +00:00