The original name `retrieve_widgets()` was unclear as it suggested it was a getter, i.e. getting the widgets. This function does more than get: finds orphaned widgets, assigns them to the inactive sidebar, and updates the database.
The new name is `sync_registered_widgets()` which better represents what happens when this function is invoked.
The original `retrieve_widgets()` function is soft deprecated to avoid unnecessary code churn downstream for developers that support more than the latest version of WordPress.
Follow-up to [18630].
Props zieladam, timothyblynjacobs, andraganescu, hellofromTonya.
See #53811.
Built from https://develop.svn.wordpress.org/trunk@51705
git-svn-id: http://core.svn.wordpress.org/trunk@51311 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This updates the Custom HTML and Media widgets to display the correct fields when adding or editing a widget when using accessibility mode through the Classic Widgets experience.
Follow up to [49973].
Props mark-k, sabernhardt, alexstine, circlecube, audrasjb.
Fixes#53641.
Built from https://develop.svn.wordpress.org/trunk@51701
git-svn-id: http://core.svn.wordpress.org/trunk@51307 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The `get_block_categories()` function expects either a `WP_Post` or a `WP_Block_Editor_Context` instance as the context argument, not a string.
Follow-up to [50996], [50997].
Props Enchiridion, pbearne, audrasjb.
Fixes#53757.
Built from https://develop.svn.wordpress.org/trunk@51700
git-svn-id: http://core.svn.wordpress.org/trunk@51306 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Document the `$active_signup` global in `signup_user()`.
* Update some DocBlocks per the documentation standards.
* Expand some function descriptions for clarity.
Follow-up to [37535], [37536], [41200], [43326], [49078], [50828].
Props mt8.biz, sabernhardt, audrasjb, westonruter, jayupadhyay01, mukesh27, SergeyBiryukov.
Fixes#41566.
Built from https://develop.svn.wordpress.org/trunk@51699
git-svn-id: http://core.svn.wordpress.org/trunk@51305 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The `assertDiscardWhitespace()` method uses `assertEquals()` under the hood, meaning that in reality any type of actual/expected value should be accepted by the function. Fixed the documentation to reflect that.
At the same time, only strings can contain whitespace differences. So the whitespace replacement should only be done when string values are passed.
This change (a) prevents potential `passing null to non-nullable` errors on PHP 8.1, if either of the inputs would turn out to be `null` and (b) increases tests stability.
Follow-up to [35003], [44902].
Props jrf.
See #53363.
Built from https://develop.svn.wordpress.org/trunk@51698
git-svn-id: http://core.svn.wordpress.org/trunk@51304 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The following changes improve tests stability.
The `assertEqualFields()` method expects an object and a fields array as inputs and subsequently approaches the received parameters as such, but did not verify whether the received parameters are of the expected types.
Along the same lines, the `assertSameSets()`, `assertEqualSets()`, `assertSameSetsWithIndex()` and the `assertEqualSetsWithIndex()` methods all expect arrays for both the actual as well as the expected values and uses the array function `[k]sort()` on both, but never verified that the received inputs were actually arrays, which could lead to PHP errors on the sorting function calls.
Follow-up to [30687], [42343], [48937], [48939], [51480], [51481].
Props jrf.
See #53363.
Built from https://develop.svn.wordpress.org/trunk@51697
git-svn-id: http://core.svn.wordpress.org/trunk@51303 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The private `_set_cron_array()` function expects a cron array as the first parameter, but will often be passed the - potentially updated - output of a call to `_get_cron_array()`.
When the `_get_cron_array()` function returns `false`, a "Deprecated: Automatic conversion of false to array is deprecated" warning will be thrown on PHP 8.1.
The input validation resolves the deprecation warning by setting the cron value to an empty array when not given an `array` data type.
Adds a full set of `_set_cron_array()` tests.
Follow-up to [4189], [50152].
Props jrf, hellofromTonya, peterwilsoncc.
See #53635.
Built from https://develop.svn.wordpress.org/trunk@51695
git-svn-id: http://core.svn.wordpress.org/trunk@51301 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This avoids a fatal error on PHP 8 caused by passing a zero value to `fread()` as the `$length` argument, which must be greater than zero.
This commit also amends the previous solution for similar issues elsewhere in the file to ensure consistent type for string values, instead of changing the type from `string` to `bool` when trying to read from an empty file.
Follow-up to [50355].
Props DavidAnderson, jrf, SergeyBiryukov.
Fixes#54036.
Built from https://develop.svn.wordpress.org/trunk@51686
git-svn-id: http://core.svn.wordpress.org/trunk@51292 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This makes the use of Composer on the host machine optional when using the Docker environment, which means there is no change to the process for installing, updating, and running the tests since [51559].
Props hellofromTonya, azaozz, netweb, desrosj, jrf, johnbillion
Fixes#53945
Built from https://develop.svn.wordpress.org/trunk@51685
git-svn-id: http://core.svn.wordpress.org/trunk@51291 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Installation and activation of incompatible plugins was previously disallowed in [43436] and [44978], but if such a plugin was installed manually, there was nothing on the Plugins screen that would show its compatibility status.
Showing an appropriate notice with a documentation link makes the UI more consistent and improves user experience.
Follow-up to [43436], [44937], [44939], [44978], [45043], [45165], [45546], [47573], [47816], [47819], [48172], [48636], [48637], [48638], [48640], [48652], [48653], [48654], [48660].
Props TacoVerdo, SergeyBiryukov.
Fixes#53990.
Built from https://develop.svn.wordpress.org/trunk@51678
git-svn-id: http://core.svn.wordpress.org/trunk@51284 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The `serializeAttributes()` function in JavaScript uses `JSON.stringify`, which does not encode slashes and unicode characters by default. This resulted in the PHP serialization through `json_encode()` producing different results.
This also switches from `json_encode()` to `wp_json_encode()` to prevent failures when any non UTF-8 characters are included.
Props kevinfodness, SergeyBiryukov, timothyblynjacobs.
Fixes#53936.
Built from https://develop.svn.wordpress.org/trunk@51674
git-svn-id: http://core.svn.wordpress.org/trunk@51280 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This is the correct formatting detailed in the Docker `compose` documentation examples and helps to avoid ambiguities in the yaml parser when values that may cause warnings.
Props pbrearne, ocean90, johnbillion, desrosj.
Fixes#53820.
Built from https://develop.svn.wordpress.org/trunk@51673
git-svn-id: http://core.svn.wordpress.org/trunk@51279 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This new custom property, `--wp-admin--admin-bar--height`, reflects the admin bar's height and adjusts responsively on smaller screens. It can be used to offset content to avoid overlapping the admin bar, without needing to copy the media query.
This also removes a workaround only needed for Internet Explorer 6 and below.
Props nico23, sabernhardt.
Fixes#52623.
Built from https://develop.svn.wordpress.org/trunk@51672
git-svn-id: http://core.svn.wordpress.org/trunk@51278 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The PHPUnit tests are/should generally be run on the `src` directory, so changes just made can be tested. While testing via the `build` directory is also still supported, this is not the default.
This was last changed in [50441], but that commit did not remove/update the error message thrown by the test bootstrap file.
This last change also did not take into account that that change meant that people had to update their own `wp`tests-config.php` file to match the change made in Core and would otherwise still get the outdated error message.
This commit changes the messaging in the test bootstrap file to be more in line with the current reality, while still accounting for the fact that tests can be run from both `src` as well as `build`.
Follow-up to [49569], [50441], [51581].
Props jrf, hellofromTonya.
Built from https://develop.svn.wordpress.org/trunk@51669
git-svn-id: http://core.svn.wordpress.org/trunk@51275 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The WPCS sniff already takes the test classes in the `tests/phpunit/includes` directory into account.
Only the test cases outside of that directory, i.e. in the `tests/phpunit/tests` directory need to be listed here.
Includes alphabetizing the list.
Follow-up to [42346], [45607].
Props jrf, hellofromTonya, SergeyBiryukov.
See #53359.
Built from https://develop.svn.wordpress.org/trunk@51659
git-svn-id: http://core.svn.wordpress.org/trunk@51265 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The `WP_Sitemaps_Provider::get_sitemap_url()` method calls the PHP native `http_build_query()` function, the second parameter of which is the ''optional'' `$numeric_prefix` parameter which expects a `string`.
A parameter being optional, however, does not automatically make it nullable.
As of PHP 8.1, passing `null` to a non-nullable PHP native function will generate a deprecation notice.
In this case, this function call yielded a `http_build_query(): Passing null to parameter #2 ($numeric_prefix) of type string is deprecated` notice.
Changing the `null` to an empty string fixes this without a backward compatibility break.
This change is already covered by tests as 14 of the existing tests failed on these function calls when running the tests on PHP 8.1.
References:
* [https://www.php.net/manual/en/function.http-build-query.php PHP Manual: http_build_query()]
* [https://wiki.php.net/rfc/deprecate_null_to_scalar_internal_arg PHP RFC: Deprecate passing null to non-nullable arguments of internal functions]
Follow-up to [48470].
Props jrf.
See #53635.
Built from https://develop.svn.wordpress.org/trunk@51652
git-svn-id: http://core.svn.wordpress.org/trunk@51258 1a063a9b-81f0-0310-95a4-ce76da25c4cd