44123 Commits

Author SHA1 Message Date
Sergey Biryukov
2a73ddeab0 Tests: Use more appropriate assertions in various tests.
This replaces instances of `assertTrue( is_object( ... ) )` with `assertIsObject()` to use native PHPUnit functionality.

Follow-up to [51331], [51335].

See #53363.

git-svn-id: https://develop.svn.wordpress.org/trunk@51337 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-06 12:31:19 +00:00
Sergey Biryukov
24479f2141 Tests: Use more appropriate assertions in various tests.
This replaces instances of `assertTrue( is_array( ... ) )` with `assertIsArray()` to use native PHPUnit functionality.

Follow-up to [51331].

See #53363.

git-svn-id: https://develop.svn.wordpress.org/trunk@51335 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-06 12:25:53 +00:00
Sergey Biryukov
67f31935d0 Tests: Move loading compatibility layers for PHPUnit 6+ and 7.5+ closer together.
Follow-up to [40536], [44701], [50986].

See #53363.

git-svn-id: https://develop.svn.wordpress.org/trunk@51333 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-06 11:33:27 +00:00
jorbin
7026369035 Update the IRC link from Freenode to Libera.chat.
Update follows the update to https://make.wordpress.org/support/handbook/appendix/other-support-locations/introduction-to-irc/.

Fixes #53590.
Props empatogen, audrasjb.


git-svn-id: https://develop.svn.wordpress.org/trunk@51332 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-05 19:30:02 +00:00
Sergey Biryukov
bca693b190 Build/Test Tools: Replace assertInternalType() usage in unit tests.
The `assertInternalType()` and `assertNotInternalType()` methods are deprecated in PHPUnit 8 and removed in PHPUnit 9.

While WordPress test suite currently only supports PHPUnit up to 7.5.x, this allows us to switch to newer assertions ahead of adding full support for PHPUnit 8+.

These methods introduced in PHPUnit 7.5 should be used as an alternative:

* `assertIsArray()`
* `assertIsBool()`
* `assertIsFloat()`
* `assertIsInt()`
* `assertIsNumeric()`
* `assertIsObject()`
* `assertIsResource()`
* `assertIsString()`
* `assertIsScalar()`
* `assertIsCallable()`
* `assertIsIterable()`
* `assertIsNotArray()`
* `assertIsNotBool()`
* `assertIsNotFloat()`
* `assertIsNotInt()`
* `assertIsNotNumeric()`
* `assertIsNotObject()`
* `assertIsNotResource()`
* `assertIsNotString()`
* `assertIsNotScalar()`
* `assertIsNotCallable()`
* `assertIsNotIterable()`

As WordPress currently uses PHPUnit 5.7.x to run tests on PHP 5.6, polyfills for these methods are now added to the `WP_UnitTestCase` class for PHPUnit < 7.5.

Props pbearne, jrf, dd32, SergeyBiryukov.
Fixes #53491. See #46149.

git-svn-id: https://develop.svn.wordpress.org/trunk@51331 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-05 17:21:53 +00:00
John Blackbourn
fee45f935c Docs: Miscellaneous docblock improvements.
See #53399


git-svn-id: https://develop.svn.wordpress.org/trunk@51330 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-05 15:46:40 +00:00
Sergey Biryukov
19751bd0d3 Docs: Correct description for the upgrader_pre_install filter.
Props ilovecats7.
Fixes #53546.

git-svn-id: https://develop.svn.wordpress.org/trunk@51329 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-04 10:05:33 +00:00
Sergey Biryukov
5324c6b4dd Docs: Add @since tags for WP_Theme class properties.
Document WordPress versions Twenty Twelve and later bundled themes were introduced in.

See #53399.

git-svn-id: https://develop.svn.wordpress.org/trunk@51328 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-04 09:57:02 +00:00
johnbillion
5383af8483 Docs: Add and correct examples of common names for various dynamic hooks.
See #53581


git-svn-id: https://develop.svn.wordpress.org/trunk@51327 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-03 21:41:02 +00:00
John Blackbourn
35cf314f9a Docs: Document common names for dynamic hooks relating to metadata.
See #53581


git-svn-id: https://develop.svn.wordpress.org/trunk@51326 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-03 21:31:13 +00:00
Sergey Biryukov
92b8387b4c Docs: Correct @see references for hooks in the get_option() description.
Follow-up to [51050].

See #52628, #53461.

git-svn-id: https://develop.svn.wordpress.org/trunk@51324 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-03 11:31:00 +00:00
Sergey Biryukov
f1d2680ed8 Bundled Themes: Correct @since tags for block patterns.
Follow-up to [49347], [49348], [49583], [49584], [49763], [51103].

See #52628, #53461.

git-svn-id: https://develop.svn.wordpress.org/trunk@51323 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-03 09:40:51 +00:00
Sergey Biryukov
f9279f497c Twenty Twenty: Add missing documentation for some filters.
Add missing `@since` tags for some functions.

Correct alignment of some `@param` tags.

Follow-up to [46271], [46278], [51304].

See #52628, #53461.

git-svn-id: https://develop.svn.wordpress.org/trunk@51322 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-03 09:13:48 +00:00
Aaron Jorbin
b97fe776da Remove unnecessary function_exists check in get_the_block_template_html
WordPress can be confident that WordPress functions exist.

I forgot this function existed.
And I thought that it would fatal, but it didn't
And it was so nice
So peaceful and quiet
I forgot this function existed
It isn't love, it isn't hate, it's just indifference

Introduced in [51003].

Props walbo.
Fixes #53578. See #53176.


git-svn-id: https://develop.svn.wordpress.org/trunk@51321 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-02 21:51:54 +00:00
Jonathan Desrosiers
8477f505be Editor: Ensure global styles are loaded in the footer when loading core assets individually.
This fixes the logic in `wp_enqueue_global_styles()` to ensure that global styles are loaded in the footer when a site opts-in to loading Core block assets individually.

This fixes a bug where styles defined in `themes.json` are not respected.

Props walbo, nosolosw, mcsf, aristath, desrosj.
Fixes #53494.

git-svn-id: https://develop.svn.wordpress.org/trunk@51309 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-02 18:46:58 +00:00
Jonathan Desrosiers
66d9364d39 Editor: Ensure the Query block pattern category is translatable.
Because the `__()` translation function was used here, the Query block pattern category string is not translatable. `_x()` is the correct function here as that passes the second parameter as context and not text domain.

Follow up to [50948].

Props walbo.
Fixes #53577.

git-svn-id: https://develop.svn.wordpress.org/trunk@51307 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-02 14:34:24 +00:00
Jonathan Desrosiers
d64fe64bbb Editor: Remove the experimental experimental-link-color feature.
This has been plugin only so far and should remain so.

Follow up to [50959].

Props nosolosw.
Fixes #53175.

git-svn-id: https://develop.svn.wordpress.org/trunk@51306 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-02 13:01:59 +00:00
Sergey Biryukov
7d72515899 Twenty Twenty-One: Add missing documentation for some filters.
Add missing `@since` tags for some functions.

Follow-up to [49216], [49220], [49854], [51294].

See #52628, #53461.

git-svn-id: https://develop.svn.wordpress.org/trunk@51304 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-02 08:56:06 +00:00
Sergey Biryukov
d7da5878ad Docs: Correct description for the $image parameter of the wp_save_image_file filter.
Follow-up to [27357], [48798], [51302].

See #53399.

git-svn-id: https://develop.svn.wordpress.org/trunk@51303 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-02 07:10:29 +00:00
John Blackbourn
077504e755 Docs: Further type corrections and improvements for various docblocks.
See #53399


git-svn-id: https://develop.svn.wordpress.org/trunk@51302 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-01 22:01:44 +00:00
John Blackbourn
4aed272097 Docs: Undo the accidental revert of [51299] made in [51300].
See #53399


git-svn-id: https://develop.svn.wordpress.org/trunk@51301 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-01 21:28:38 +00:00
John Blackbourn
d059b898fe Docs: Descriptive improvements and corrections for various docblocks.
See #53399


git-svn-id: https://develop.svn.wordpress.org/trunk@51300 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-01 21:11:48 +00:00
John Blackbourn
5dd7fde41d Docs: Miscellaneous formatting corrections for docblocks.
See #53399


git-svn-id: https://develop.svn.wordpress.org/trunk@51299 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-01 21:09:04 +00:00
John Blackbourn
28ea7b18cf Docs: Corrections and improvements to types used in docblocks for symbols, properties, and filters.
See #53399


git-svn-id: https://develop.svn.wordpress.org/trunk@51298 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-01 21:01:17 +00:00
John Blackbourn
4d431f89d5 Docs: Fix the documentation for the $tests parameter of the site_status_tests filter.
Tests are contained within `direct` and `async` properties of this array, not directly in the array itself. This also clarifies the properties that differ between direct and async tests.

See #53399, #46573


git-svn-id: https://develop.svn.wordpress.org/trunk@51297 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-01 20:36:12 +00:00
Jonathan Desrosiers
9ae3f12d7d Twenty Twenty-One: Ensure the dropdown arrow displays for <select> elements when focused.
Props isabel_brison, zieladam, poena.
Fixes #53560.

git-svn-id: https://develop.svn.wordpress.org/trunk@51296 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-01 19:54:07 +00:00
Sergey Biryukov
b086890eb9 Twenty Twenty-One: Improve documentation per the documentation standards:
* Remove unnecessary `@access` tags that were previously removed from core.
* Remove an empty line between `@param` and `@return` tags.
* Correct alignment of `@param` tags.

Follow-up to [41161], [41162], [41168], [49216], [49220].

See #52628, #53461.

git-svn-id: https://develop.svn.wordpress.org/trunk@51294 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-01 12:58:34 +00:00
Sergey Biryukov
278843f8e3 Docs: Correct documentation for rest_{$post_type}_query and rest_{$taxonomy}_query filters.
Synchronize documentation for related `rest_{$object_type}_query` filters for consistency.

Props dlh.
Fixes #53568.

git-svn-id: https://develop.svn.wordpress.org/trunk@51293 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-01 09:11:29 +00:00
Sergey Biryukov
ee18b460b8 Docs: Improve documentation for optional parameters in WP_Theme_JSON methods per the documentation standards.
Additionally:
* Remove an empty line between `@param` and `@return` tags.
* Correct alignment of `@param` tags.

Follow-up to [50959], [50973], [51149], [51284], [51289].

See #52628, #53461.

git-svn-id: https://develop.svn.wordpress.org/trunk@51292 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-30 18:59:55 +00:00
Sergey Biryukov
3478f645bc Docs: Remove an empty line between @param and @return tags in some newly added REST API methods, per the documentation standards.
Follow-up to [48242], [49925], [51003], [51021].

See #52628, #53461.

git-svn-id: https://develop.svn.wordpress.org/trunk@51289 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-30 18:42:59 +00:00
Jonathan Desrosiers
a7804f73e1 Script Loader: Revert [51267].
This was missed in [51268] when reverting [51259-51260,51265].

Props pbiron.
See #53397.

git-svn-id: https://develop.svn.wordpress.org/trunk@51288 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-30 18:24:39 +00:00
Sergey Biryukov
6da1212c97 Coding Standards: Add missing visibility keywords to WP_Theme, WP_Theme_JSON, and WP_Theme_JSON_Resolver tests.
Follow-up to [50959], [50960], [50967].

See #52627.

git-svn-id: https://develop.svn.wordpress.org/trunk@51287 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-30 18:21:52 +00:00
Sergey Biryukov
4ada6a40e7 Docs: List the expected type first instead of WP_Error in some REST API methods added in 5.8.
Follow-up to [46696], [49929], [50995], [51021].

See #52628, #53461.

git-svn-id: https://develop.svn.wordpress.org/trunk@51286 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-30 17:58:03 +00:00
Sergey Biryukov
f6f73c48ee Coding Standards: Remove redundant type casting to array in WP_Query::get_posts().
This brings some consistency with other instances of using `get_post_stati()` in core.

`get_post_stati()` always returns an array, so the type casting is not needed.

Follow-up to [13172].

See #53359.

git-svn-id: https://develop.svn.wordpress.org/trunk@51285 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-30 17:43:29 +00:00
Sergey Biryukov
7041541417 Docs: Improve documentation for optional parameters in WP_Theme_JSON_Resolver methods per the documentation standards.
Move `add_action()` call to `wp-includes/default-filters.php`.

Follow-up to [50959], [51221].

See #52628, #53461.

git-svn-id: https://develop.svn.wordpress.org/trunk@51284 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-30 17:19:59 +00:00
Sergey Biryukov
b48eca78cb Docs: Add missing @since tags for some WP_Theme_JSON methods.
Docs: Update syntax for multi-line comments per the documentation standards.

Follow-up to [50959], [50967], [50973], [51051], [51089], [51149].

See #52628, #53461.

git-svn-id: https://develop.svn.wordpress.org/trunk@51283 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-30 16:22:22 +00:00
Sergey Biryukov
fee6c1d81a Docs: Adjust wp_dashboard_browser_nag() DocBlock per the documentation standards.
Follow-up to [51117], [51119], [51120].

See #52628, #53461.

git-svn-id: https://develop.svn.wordpress.org/trunk@51282 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-30 16:06:03 +00:00
Sergey Biryukov
f6760ece8e Docs: Add @ticket references to some WP_Theme_JSON tests.
Follow-up to [50973], [51054].

See #52628, #53461.

git-svn-id: https://develop.svn.wordpress.org/trunk@51281 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-30 15:58:51 +00:00
Sergey Biryukov
40b5523fe5 Docs: Add missing @since tags for some REST API methods added in 5.8.
Follow-up to [50995], [51021].

See #52628, #53461.

git-svn-id: https://develop.svn.wordpress.org/trunk@51280 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-30 13:57:10 +00:00
Sergey Biryukov
1fffb4642c Docs: Document the globals used in WP_REST_Widget_Types_Controller and WP_REST_Widgets_Controller.
Follow-up to [50995].

See #52628, #53461.

git-svn-id: https://develop.svn.wordpress.org/trunk@51279 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-30 12:54:10 +00:00
Sergey Biryukov
aa99d7e7a3 Docs: Document the globals used in some REST API methods.
See #53399.

git-svn-id: https://develop.svn.wordpress.org/trunk@51278 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-30 12:33:43 +00:00
Sergey Biryukov
8a7495701f REST API: Allow multiple widgets to be deleted in a single batch request.
This resets the `WP_Widget::$updated` flag when deleting a widget, to avoid blocking all future updates in a request.

Props noisysocks, andraganescu.
Fixes #53557.

git-svn-id: https://develop.svn.wordpress.org/trunk@51277 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-30 10:40:21 +00:00
Peter Wilson
212c928038 Query: Check each post-type's capabilities when querying multiple post-types.
When querying multiple post types, check the `read_private_posts` capability for each post type when determining which post statuses to return. This ensures private posts appear in search results and archives for users permitted to read them.

Props leogermani, hellofromTonya, jeffpaul, peterwilsoncc.
Fixes #48556.



git-svn-id: https://develop.svn.wordpress.org/trunk@51276 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-30 04:59:10 +00:00
Jonathan Desrosiers
41c00084dc Security: Add 5.8 to the list of versions receiving security updates.
git-svn-id: https://develop.svn.wordpress.org/trunk@51274 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-30 04:01:48 +00:00
Jonathan Desrosiers
c7d284653b Build/Test Tools: Add the 5.8 branch to the workflow for testing branches.
git-svn-id: https://develop.svn.wordpress.org/trunk@51273 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-30 03:57:04 +00:00
Jonathan Desrosiers
a749bada78 Post branching 5.8 version bump.
`trunk` is now `5.9-alpha`.

git-svn-id: https://develop.svn.wordpress.org/trunk@51272 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-30 03:54:44 +00:00
Jonathan Desrosiers
47b4353470 Post WordPress 5.8 RC1 version bump.
git-svn-id: https://develop.svn.wordpress.org/trunk@51270 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-30 03:43:41 +00:00
Jonathan Desrosiers
fd3e1b346b WordPress 5.8 RC1.
git-svn-id: https://develop.svn.wordpress.org/trunk@51269 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-30 03:15:39 +00:00
Jonathan Desrosiers
36012064f6 Build/Test Tools: Revert [51259-51256,51265].
[51259] introduced a PHP notice that was not actually fixed by [51265]. Reverting these changes in order to investigate further.

See #53397.

git-svn-id: https://develop.svn.wordpress.org/trunk@51268 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-30 02:13:30 +00:00
Jonathan Desrosiers
9488d3dc7f Script Loader: Fix PHP notice caused by the viewScript for the core/file block.
This fixes a PHP notice caused by the `viewScript` for the `core/file` block having `.min.js` instead of just `.js`.

`register_block_script_handle()` was incorrectly looking for `view.min.asset.php`, which does not exist, and caused the `_doing_it_wrong()` notice.

This adds a check for `.min.js` in the `viewScript` field of `block.json` and corrects it to `.js` in order to match the expected pattern of `view.asset.php` until a more permanent fix can be created.

Follow up to [51259].

Props ipstenu, pbiron, peterwilsoncc.
See #53397.

git-svn-id: https://develop.svn.wordpress.org/trunk@51267 602fd350-edb4-49c9-b593-d223f7449a82
2021-06-30 01:45:10 +00:00