Commit Graph

45702 Commits

Author SHA1 Message Date
Sergey Biryukov
90f953603b Query: Restore late compact() call for the posts_clauses_request filter.
This addresses a backward compatibility break where `posts_join_request` and other filters were applied, but their results were subsequently discarded and earlier values were used instead.

Follow-up to [52974], [53175].

Props 5um17, johnbillion, SergeyBiryukov.
Fixes #55699.

git-svn-id: https://develop.svn.wordpress.org/trunk@53370 602fd350-edb4-49c9-b593-d223f7449a82
2022-05-09 13:49:29 +00:00
Peter Wilson
a6eec99e46 Quick/Bulk Edit: Additional tests for showing taxonomies.
Additional tests to ensure taxonomies show in the quick/bulk edit froms based on the `show_in_quick_edit` setting rather than the the `show_ui` setting.

Follow up to [52841,31307].

Props figureone, costdev, audrasjb.
Fixes #49701.



git-svn-id: https://develop.svn.wordpress.org/trunk@53368 602fd350-edb4-49c9-b593-d223f7449a82
2022-05-09 00:32:39 +00:00
Peter Wilson
d8ef0cd52e Script Loader: Explain why i18n prevents concatenation.
Add inline comment to `WP_Scripts::do_item()` explaining why the definition of a text domain prevents concatenation.

Follow up to [53360].

Fixes #55628.
Props SergeyBiryukov.



git-svn-id: https://develop.svn.wordpress.org/trunk@53366 602fd350-edb4-49c9-b593-d223f7449a82
2022-05-08 23:57:19 +00:00
Sergey Biryukov
91fe405d61 Code Modernization: Rename parameters to match native PHP functions in wp-includes/compat.php.
This ensures that parameter names for PHP polyfills in WordPress core 100% match the native PHP parameter names. Otherwise using named parameters with those functions could cause fatal errors for installs where the polyfills kick in.

This commit:
* Renames the `$string` parameter to `$message` in `_()` polyfill.
* Renames the `$str` parameter to `$string` in `mb_substr()` and `mb_strlen()` polyfills.
* Renames the `$raw_output` parameter to `$binary` in `hash_hmac()` polyfill.
* Renames the `$a` and `$b` parameters to `$known_string` and `$user_string` in `hash_equals()` polyfill.
* Renames the `$var` parameter to `$value` in `is_countable()` and `is_iterable()` polyfills.
* Renames the `$arr` parameter to `$array` in `array_key_first()` and `array_key_last()` polyfills.

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207], [53215], [53216], [53220], [53230], [53232], [53236], [53239], [53240], [53242], [53243], [53245], [53246], [53257], [53269], [53270], [53271], [53272], [53273], [53274], [53275], [53276], [53277], [53281], [53283], [53284], [53285], [53287], [53364].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55650.

git-svn-id: https://develop.svn.wordpress.org/trunk@53365 602fd350-edb4-49c9-b593-d223f7449a82
2022-05-08 00:27:41 +00:00
Sergey Biryukov
e4fbdea354 Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/template.php.
While using reserved PHP keywords as parameter name labels is allowed, in the context of function calls using named parameters in PHP 8.0+, this will easily lead to confusion. To avoid that, it is recommended not to use reserved keywords as function parameter names.

This commit renames the `$parent` parameter to `$parent_page` in `parent_dropdown()`.

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207], [53215], [53216], [53220], [53230], [53232], [53236], [53239], [53240], [53242], [53243], [53245], [53246], [53257], [53269], [53270], [53271], [53272], [53273], [53274], [53275], [53276], [53277], [53281], [53283], [53284], [53285], [53287].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55650.

git-svn-id: https://develop.svn.wordpress.org/trunk@53364 602fd350-edb4-49c9-b593-d223f7449a82
2022-05-07 17:14:20 +00:00
Sergey Biryukov
3f7cfd9ac6 Coding Standards: Remove extra space in wp-admin/admin-ajax.php.
Props rajeshraval786, costdev.
Fixes #55692.

git-svn-id: https://develop.svn.wordpress.org/trunk@53363 602fd350-edb4-49c9-b593-d223f7449a82
2022-05-07 16:19:53 +00:00
Peter Wilson
e17a83df22 Users: Allow any DB field to be returned by WP_User_Query.
Restore behaviour of `fields` parameter in `WP_User_Query` to allow developers to specify any database field to be returned either individually or as part of a subset. Add these fields to the documentation.

When a subset of `fields` includes the `id` paramater, include it in the results in both upper and lowercase to maintain backward compatibility.

Follow up to [53327].

Props dd32, pbearne, kraftbj, peterwilsoncc.
Fixes #53177.



git-svn-id: https://develop.svn.wordpress.org/trunk@53362 602fd350-edb4-49c9-b593-d223f7449a82
2022-05-07 03:30:51 +00:00
Peter Wilson
09923cc040 Script Loader: Fix i18n edge case breaking dependencies.
Prevent concatenation of scripts if the text domain is defined to ensure the dependency order is respected. 

This accounts for an edge case in which replacing a core script via a plugin and a lack of translations (eg, for a US English site) could cause the JavaScript files to be ordered incorrectly.

Follow up to [52937].

Props audrasjb, boniu91, chaion07, costdev, hellofromtonya, jsnajdr, mukesh27, ndiego, ugyensupport.
Fixes #55628.


git-svn-id: https://develop.svn.wordpress.org/trunk@53360 602fd350-edb4-49c9-b593-d223f7449a82
2022-05-07 02:51:54 +00:00
John Blackbourn
5751ac9ffc Build/Test Tools: Allow the local development environment to run on Apple M1 machines without requiring local configuration changes.
The `amd64/mysql` and `amd64/mariadb` official images from Docker are compatible with x86 running on the ARM64v8 architecture of M1 machines.

Props afragen, justinahinon, desrosj, talldanwp, antonvlasenko, gziolo, aristath, johnbillion

Fixes #52356


git-svn-id: https://develop.svn.wordpress.org/trunk@53358 602fd350-edb4-49c9-b593-d223f7449a82
2022-05-06 17:14:10 +00:00
Sergey Biryukov
7f0758ec02 Tests: Improve the logic of the SECURITY.md test to check all supported versions.
This avoids a test failure if the list of supported WordPress versions is updated before the trunk version is bumped for a new major release.

Follow-up to [47403], [53347].

Fixes #55667.

git-svn-id: https://develop.svn.wordpress.org/trunk@53357 602fd350-edb4-49c9-b593-d223f7449a82
2022-05-06 11:09:54 +00:00
Sergey Biryukov
62040b8b9d Site Health: Remove unused variables in WP_Site_Health::get_test_plugin_version().
Follow-up to [44986].

Props david.binda, mukesh27.
Fixes #55683.

git-svn-id: https://develop.svn.wordpress.org/trunk@53355 602fd350-edb4-49c9-b593-d223f7449a82
2022-05-05 16:27:30 +00:00
Kelly Choyce-Dwan
94e4dfdb23 Help/About: Add link to 6.0 Field Guide, fix missing placeholder in string.
Props audrasjb.
Follow-up to [53339].
See #55434.



git-svn-id: https://develop.svn.wordpress.org/trunk@53354 602fd350-edb4-49c9-b593-d223f7449a82
2022-05-05 15:33:07 +00:00
hellofromTonya
4f2a98929e Editor: Add unit test for Comment Template block.
Backport of 2 tests from Gutenberg for the Comment Template block:

* test line and paragraph breaks are converted into HTML tags.
* test rendering of unapproved comment preview.

Follow-up to [53298], [53172], [53138].

Props bernhard-reiter, darerodz, gziolo, peterwilsoncc, hellofromTonya. 
Fixes #55643.
See #55634.

git-svn-id: https://develop.svn.wordpress.org/trunk@53353 602fd350-edb4-49c9-b593-d223f7449a82
2022-05-05 15:27:01 +00:00
Peter Wilson
b27069117e Quick/Bulk Edit: Remove duplicate HTML IDs.
Rename `#inline-edit-legend` to avoid duplicate HTML IDs. These have been renamed `#quick-edit-legend` and `#bulk-edit-legend` for the quick and bulk editors respectively.

This HTML ID is not required by the quick editor duplicated via JavaScript so is removed as part of the duplication process.

Follow up to [53096].

Props azaozz, costdev, greglone, hellofromtonya, ironprogrammer, joedolson, sabernhardt.
Fixes #55575.
See #35483.



git-svn-id: https://develop.svn.wordpress.org/trunk@53352 602fd350-edb4-49c9-b593-d223f7449a82
2022-05-05 03:24:33 +00:00
Sergey Biryukov
04e9728701 Build/Test Tools: Pass GitHub Actions environment variables to the Docker container.
This ensures that `WP_UnitTestCase::skipOnAutomatedBranches()` has access to the `GITHUB_REF` and `GITHUB_EVENT_NAME` variables, so that some tests can be skipped when appropriate.

Additionally, account for renaming the `master` branch to `trunk` in November 2021.

Follow-up to [40241], [46999], [49264], [49267], [51868].

Fixes #55668.

git-svn-id: https://develop.svn.wordpress.org/trunk@53349 602fd350-edb4-49c9-b593-d223f7449a82
2022-05-04 00:38:18 +00:00
Tonya Mork
546114eca8 Build/Test Tools: Ensure version number is in 'X.X' format after float math: Tests_Basic::test_security_md().
After subtracing `0.1` from a `X.1` current version, the result was a single digit without the `.0` decimal. Using `number_format()` ensures each current version has a decimal before appending the `.x` before the test.

This commit also reverts [55346] which was a temporary workaround.

Follow-up to [55346], [47403].
Fixes #55667.

git-svn-id: https://develop.svn.wordpress.org/trunk@53347 602fd350-edb4-49c9-b593-d223f7449a82
2022-05-03 18:55:45 +00:00
Sergey Biryukov
ad835148ff Tests: Temporarily disable the test for "Supported Versions" section of GitHub Security Policy.
The test needs to be adjusted to handle major version changes correctly.

git-svn-id: https://develop.svn.wordpress.org/trunk@53346 602fd350-edb4-49c9-b593-d223f7449a82
2022-05-03 18:14:33 +00:00
Sergey Biryukov
9b97edabe5 Build/Test Tools: Add the 6.0 branch to the workflow for testing branches.
git-svn-id: https://develop.svn.wordpress.org/trunk@53345 602fd350-edb4-49c9-b593-d223f7449a82
2022-05-03 17:42:22 +00:00
Sergey Biryukov
ae9e0bb74f Trunk is now 6.1-alpha.
git-svn-id: https://develop.svn.wordpress.org/trunk@53344 602fd350-edb4-49c9-b593-d223f7449a82
2022-05-03 17:38:14 +00:00
Sergey Biryukov
469bcedbcc Security: Update the Security Policy to include WordPress 6.0.
git-svn-id: https://develop.svn.wordpress.org/trunk@53342 602fd350-edb4-49c9-b593-d223f7449a82
2022-05-03 17:32:25 +00:00
Sergey Biryukov
64025d0abe Post WordPress 6.0 RC1 version bump.
git-svn-id: https://develop.svn.wordpress.org/trunk@53341 602fd350-edb4-49c9-b593-d223f7449a82
2022-05-03 17:13:20 +00:00
Sergey Biryukov
6d93192ee9 WordPress 6.0 RC1
git-svn-id: https://develop.svn.wordpress.org/trunk@53340 602fd350-edb4-49c9-b593-d223f7449a82
2022-05-03 16:44:39 +00:00
Kelly Choyce-Dwan
2b17e69e72 Help/About: Update the About section for 6.0.
This is the start of the WordPress 6.0 about page, introducing new content and a first pass of the new style.

Props fcoveram, estelaris, JeffPaul, critterverse, chanthaboune, dansoschin, webcommsat, annezazu, marybaum, cbringmann, eidolonnight, laurlittle, sergeybiryukov.
See #55434.



git-svn-id: https://develop.svn.wordpress.org/trunk@53339 602fd350-edb4-49c9-b593-d223f7449a82
2022-05-03 16:26:53 +00:00
Tonya Mork
4023853156 Editor: Update WordPress packages for 6.0 RC1.
Included cherry-picked commits from the Gutenberg plugin that fix bugs discovered after WordPress 6.0 Beta 4.

Props gziolo, zieladam, ndiego.

See #55567.

git-svn-id: https://develop.svn.wordpress.org/trunk@53338 602fd350-edb4-49c9-b593-d223f7449a82
2022-05-03 14:58:54 +00:00
Jb Audras
929e4e4f9e General: Add missing strong tag to some error messages.
This changeset adds missing `strong` tag to some error messages and updates some AJAX messages, for better consistency.

Follow-up to [53118].

Props NekoJonez, audrasjb, ocean90.
Fixes #54437.


git-svn-id: https://develop.svn.wordpress.org/trunk@53337 602fd350-edb4-49c9-b593-d223f7449a82
2022-05-03 14:51:41 +00:00
Tonya Mork
6dab53e93b Editor: Sets 'paged' query arg only when there are comments: build_comment_query_vars_from_block().
A SQL syntax error happened when a post has no comments and "Break comments into pages" is checked in Settings > Discussion. The fix sets the `'paged'` query arg only when there are comments. When there are no comments, `WP_Comment_Query` sets the default `'paged'` value to `1`.

Props bernhard-reiter, luisherranz, czapla, cbravobernal, davidbaumwald, hellofromTonya.

Follow-up to [53142], [53138].
Fixes #55658.

git-svn-id: https://develop.svn.wordpress.org/trunk@53336 602fd350-edb4-49c9-b593-d223f7449a82
2022-05-03 14:31:12 +00:00
Sergey Biryukov
4558de543c Post WordPress 6.0 Beta 4 version bump.
git-svn-id: https://develop.svn.wordpress.org/trunk@53335 602fd350-edb4-49c9-b593-d223f7449a82
2022-05-02 16:42:03 +00:00
Sergey Biryukov
74dd0397fc WordPress 6.0 Beta 4.
git-svn-id: https://develop.svn.wordpress.org/trunk@53334 602fd350-edb4-49c9-b593-d223f7449a82
2022-05-02 16:08:37 +00:00
Tonya Mork
dc3204ec1d REST API: Fixes /wp/v2/pattern-directory/patterns endpoint response for slug parameter.
[53218] introduced a bug of a wrong response from the `wp/v2/pattern-directory/patterns` endpoint with a `slug` parameter. As the response is cached, it can result in an incorrect list of available patterns supported by the current theme.

This commit resolves by:

* Limiting the `slug` to an `array` in the query parameters.
* When set, parsing and sorting the slug(s) and then serializing the sorted query args as part of the hashed transient keys.

Props antonvlasenko, timothyblynjacobs, spacedmonkey, costdev, hellofromTonya.

Follow-up to [53218], [53152], [51208].
Fixes #55617.

git-svn-id: https://develop.svn.wordpress.org/trunk@53333 602fd350-edb4-49c9-b593-d223f7449a82
2022-05-02 13:58:48 +00:00
Jb Audras
9e6e4b5893 Docs: Correct parameter types for serialize_block() and serialize_blocks().
This changeset clarifies the expected type for the first parameter passed to `serialize_block()` and `serialize_blocks()` functions.

Props manooweb.
Fixes #55648.
See #54729.


git-svn-id: https://develop.svn.wordpress.org/trunk@53332 602fd350-edb4-49c9-b593-d223f7449a82
2022-05-02 13:30:47 +00:00
Sergey Biryukov
50f2d7da7d Docs: Remove @return void from various DocBlocks.
Per the documentation standards, it should not be used outside of the default bundled themes.

Follow-up to [38767], [47055], [49697], [50956], [51003], [52069], [53255].

See #54729.

git-svn-id: https://develop.svn.wordpress.org/trunk@53331 602fd350-edb4-49c9-b593-d223f7449a82
2022-05-02 13:11:07 +00:00
Sergey Biryukov
a913b7312d Docs: Improve plugin_install_action_links filter's docs.
Refer developers to `plugins_api()` for array of plugin data.

Follow-up to [53074], [53328].

Props afragen, pbiron.
See #55480.

git-svn-id: https://develop.svn.wordpress.org/trunk@53330 602fd350-edb4-49c9-b593-d223f7449a82
2022-05-02 13:05:53 +00:00
Greg Ziółkowski
e0837a8b18 Editor: Update WordPress packages for 6.0 Beta 4
Included cherry-picked commits from the Gutenberg plugin that fix bugs discovere after WordPress 6.0 Beta 3.

Props zieladam, ndiego, darerodz.
See #55567.




git-svn-id: https://develop.svn.wordpress.org/trunk@53329 602fd350-edb4-49c9-b593-d223f7449a82
2022-05-02 10:36:45 +00:00
Peter Wilson
1b9551de27 Plugins: Improve plugin_install_description filter's docs.
Refer developers to `plugins_api()` for array of plugin data.

Props afragen, pbiron, SergeyBiryukov, costdev.
Fixes #55480.



git-svn-id: https://develop.svn.wordpress.org/trunk@53328 602fd350-edb4-49c9-b593-d223f7449a82
2022-05-02 02:44:04 +00:00
Peter Wilson
63f3914e51 Users: Validate WP_User_Query's fields argument.
Improve validation of `WP_User_Query`'s `fields` argument when passed as an array to ensure it only accepts permitted values. This prevents the invalid values being included in the generated database query.

Expand unit tests to include passing invalid values as part of an array, the lower case value `id`. Correct earlier unit tests to limit database query to one result.

Follow up to [53255].

Props felipeelia.
Fixes #53177.



git-svn-id: https://develop.svn.wordpress.org/trunk@53327 602fd350-edb4-49c9-b593-d223f7449a82
2022-05-02 00:11:48 +00:00
Sergey Biryukov
36f34cf58d Tests: Add unit tests for some XML-RPC functions:
* `xmlrpc_getposttitle()`
* `xmlrpc_getpostcategory()`
* `xmlrpc_removepostdata()`

Props pbearne, audrasjb, costdev, SergeyBiryukov.
Fixes #53490.

git-svn-id: https://develop.svn.wordpress.org/trunk@53326 602fd350-edb4-49c9-b593-d223f7449a82
2022-05-02 00:11:35 +00:00
Jb Audras
a6afe726b9 Coding standards: Remove extra spaces in docblocks of the Walker_PageDropdown class.
Follow-up to [51779].

See #54728.


git-svn-id: https://develop.svn.wordpress.org/trunk@53325 602fd350-edb4-49c9-b593-d223f7449a82
2022-05-01 21:59:49 +00:00
Jb Audras
50add1e31b Docs: Clarify the name and description of some parameters in the Walker class.
Follow-up to [53323].
See #54729.


git-svn-id: https://develop.svn.wordpress.org/trunk@53324 602fd350-edb4-49c9-b593-d223f7449a82
2022-05-01 21:45:56 +00:00
Jb Audras
4cfee4c129 Docs: Docblock adjustements in the Walker class.
This changeset ensures third-person singular verbs are used for function descriptions in the `Walker` class, and adjusts some non-standard docblock descriptions for various properties and methods of the class.

See #54729.


git-svn-id: https://develop.svn.wordpress.org/trunk@53323 602fd350-edb4-49c9-b593-d223f7449a82
2022-05-01 21:39:02 +00:00
Sergey Biryukov
fe01209090 Coding Standards: Remove extra alignment level in the data provider for wp_validate_boolean() tests.
Follow-up to [46159], [46224], [52775], [52776], [52777].

See #54725, #54728.

git-svn-id: https://develop.svn.wordpress.org/trunk@53322 602fd350-edb4-49c9-b593-d223f7449a82
2022-05-01 16:22:58 +00:00
Sergey Biryukov
4d7e8125ae Tests: Add unit tests for wp_fuzzy_number_match().
Props pbearne, costdev, mukesh27, hellofromTonya, SergeyBiryukov.
Fixes #54239.

git-svn-id: https://develop.svn.wordpress.org/trunk@53321 602fd350-edb4-49c9-b593-d223f7449a82
2022-05-01 16:11:24 +00:00
Sergey Biryukov
6eeaa587e7 Tests: Ignore EOL differences in Webfonts API tests.
Unix vs. Windows EOL style mismatches can cause misleading failures in tests using the heredoc syntax (`<<<`) or multiline strings as the expected result.

Includes renaming the test class to match the [https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#naming-and-organization naming conventions].

Follow-up to [46612], [48443], [48466], [49691], [51135], [53282].

See #54725.

git-svn-id: https://develop.svn.wordpress.org/trunk@53319 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-30 11:33:30 +00:00
John Blackbourn
84be1644cd Docs: Improve documentation of the walker argument for various functions.
See #54729


git-svn-id: https://develop.svn.wordpress.org/trunk@53318 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-29 19:27:00 +00:00
John Blackbourn
09cdb9a9bf Docs: Formatting corrections for various docblocks.
See #54729


git-svn-id: https://develop.svn.wordpress.org/trunk@53317 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-29 19:22:56 +00:00
John Blackbourn
08fb48315a Docs: Corrections and improvements to docblocks for function and hooks relating to fatal error handling.
See #54729


git-svn-id: https://develop.svn.wordpress.org/trunk@53316 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-29 19:15:57 +00:00
John Blackbourn
5612331504 REST API: Correct the schema for the wp/v2/block-directory/search endpoint.
Props zieladam, TimothyBlynJacobs, spacedmonkey, johnbillion

Fixes #53621


git-svn-id: https://develop.svn.wordpress.org/trunk@53315 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-29 16:53:55 +00:00
Sergey Biryukov
f4416e018d Docs: Adjust comments in Gruntfile.js per the documentation standards.
See #54729.

git-svn-id: https://develop.svn.wordpress.org/trunk@53314 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-29 14:44:15 +00:00
Sergey Biryukov
b840fb84ee Docs: Further clarify a comment for the main part of wp-login.php.
Follow-up to [52945].

Fixes #54746.

git-svn-id: https://develop.svn.wordpress.org/trunk@53313 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-29 14:35:01 +00:00
Greg Ziółkowski
2b0a984227 Editor: Fix core 'Featured' pattern category registration
Backports changes from https://github.com/WordPress/gutenberg/pull/40650.

Patch fixes regression, and moves core "Featured" pattern category registration from `_load_remote_featured_patterns` into `_register_core_block_patterns_and_categories`.

Follow-up [53152].
Props mamaduka, ntsekouras.
See #55567.



git-svn-id: https://develop.svn.wordpress.org/trunk@53312 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-29 14:08:44 +00:00
Greg Ziółkowski
6a1f7d02f8 Tools: Further automate backporting from Gutenberg to Core
Follow-up for #51491.

Updating WordPress packages is currently a manual process that takes some reading and trial & error to figure out. This PR adds a single npm task called `sync-gutenberg-packages` that automates this entire process.

Props zieladam.
Fixes #55642.



git-svn-id: https://develop.svn.wordpress.org/trunk@53311 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-29 13:59:49 +00:00