Commit Graph

19942 Commits

Author SHA1 Message Date
Sergey Biryukov d7efd9a793 Docs: Add `@since` tags for `wp_die()` handlers in the PHPUnit test suite.
Follow-up to [289/tests], [28797], [41966], [53634].

See #55652, #55646.
Built from https://develop.svn.wordpress.org/trunk@53635


git-svn-id: http://core.svn.wordpress.org/trunk@53194 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-02 18:29:11 +00:00
Sergey Biryukov 6ee60c3ebe Build/Test Tools: Add support for `WP_Error` in the test suite's `wp_die()` handlers.
This brings parity with WordPress core `wp_die()` handlers and ensures that if a `WP_Error` object is passed as the `$message` argument to `wp_die()`, the PHPUnit test suite displays the error message correctly.

Previously, this would cause a silent fatal error: `Object of class WP_Error could not be converted to string`, leading to just displaying `wp_die called` without any further details.

Follow-up to [28797], [41966], [44666], [45160], [47882].

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53634


git-svn-id: http://core.svn.wordpress.org/trunk@53193 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-02 18:07:11 +00:00
Sergey Biryukov 9bea9ddfc9 Editor: Alphabetize block lists in various places.
This affects:
* `wp-includes/blocks/index.php`
* `tools/webpack/blocks.js`
* `_unhook_block_registration()` in `tests/phpunit/includes/functions.php`

Follow-up to [47250], [52069], [52730], [53157], [53278].

Fixes #56131.
Built from https://develop.svn.wordpress.org/trunk@53633


git-svn-id: http://core.svn.wordpress.org/trunk@53192 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-02 17:46:13 +00:00
Sergey Biryukov 354545bc3e Editor: Register the Comments Query Loop block from metadata.
This ensures that the block title and description can be translated.

Follow-up to [53157].

Props cbravobernal, bernhard-reiter, adamziel, gziolo, peterwilsoncc, audrasjb, mukesh27, SergeyBiryukov.
Fixes #56093. See #55809.
Built from https://develop.svn.wordpress.org/trunk@53631


git-svn-id: http://core.svn.wordpress.org/trunk@53190 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-02 14:35:14 +00:00
Sergey Biryukov 1f87125366 Widgets: Add a comment in `WP_Nav_Menu_Widget::form()` to clarify the `esc_attr()` usage.
The URL to create a new menu from the the Navigation Menu widget can be a `javascript:` link to the Customizer Menus panel, so `esc_attr()` is used here instead of `esc_url()`.

Follow-up to [53092].

Props hztyfoon.
Fixes #56128.
Built from https://develop.svn.wordpress.org/trunk@53630


git-svn-id: http://core.svn.wordpress.org/trunk@53189 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-01 20:01:15 +00:00
John Blackbourn c3188a2566 Build/Test Tools: Remove an unused build configuration file.
This is a configuration file for Apache Ant that is no longer used.

Fixes #52604

Built from https://develop.svn.wordpress.org/trunk@53629


git-svn-id: http://core.svn.wordpress.org/trunk@53188 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-01 19:56:16 +00:00
John Blackbourn f5cbb5585a Build/Test Tools: Run the PHP container with PID > 1 so Ctrl+C works correctly.
This allows for cancellation of operations in the PHP container, such as a PHPUnit test suite run.

Fixes #55702

Built from https://develop.svn.wordpress.org/trunk@53628


git-svn-id: http://core.svn.wordpress.org/trunk@53187 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-01 19:37:14 +00:00
John Blackbourn d50fbb4469 Taxonomy: Pass the `$args` parameter to all actions and filters in `wp_insert_term()` and `wp_update_term()`.
This allows actions and filters to access potentially useful contextual information when terms are inserted and updated.

Props mboynes

Fixes #55441

Built from https://develop.svn.wordpress.org/trunk@53627


git-svn-id: http://core.svn.wordpress.org/trunk@53186 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-01 19:09:14 +00:00
Sergey Biryukov 3e622b1d75 Twenty Eleven: Replace deprecated function calls on theme options page.
This includes:
* Removing the deprecated `screen_icon()` function call.
* Replacing the deprecated `get_current_theme()` function call with `get_option( 'current_theme' )`.
* Using `wp_get_theme()->display( 'Name' )` explicitly instead of relying on `WP_Theme`'s `__toString()` method, for clarity.

Follow-up to [6334], [20039], [20040], [20042], [20508], [26537], [41274].

Props Presskopp, cu121, viralsampat, costdev, tomjdv, sabernhardt, SergeyBiryukov.
Fixes #54833.
Built from https://develop.svn.wordpress.org/trunk@53626


git-svn-id: http://core.svn.wordpress.org/trunk@53185 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-01 14:26:15 +00:00
Sergey Biryukov 580d991349 Editor: Ensure only the main query is modified when resolving template for new posts.
This adds a check for the main query in `_resolve_template_for_new_post()` to fix a 404 response when resolving template for new posts or pages caused by the wrong query being modified.

Original PR from Gutenberg repository:
* [https://github.com/WordPress/gutenberg/pull/40799 #40799: Ensure only the main query is modified when resolving template for new posts]

Follow-up to [52316].

Props petitphp, zieladam, poena, ndiego, gziolo, kebbet, Mamaduka, manfcarlo.
See #56058.
Built from https://develop.svn.wordpress.org/trunk@53593


git-svn-id: http://core.svn.wordpress.org/trunk@53181 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-30 15:48:15 +00:00
desrosj 296c363bc1 Build/Test Tools: Correct some GitHub Action workflow inline documentation.
See #55652.
Built from https://develop.svn.wordpress.org/trunk@53592


git-svn-id: http://core.svn.wordpress.org/trunk@53180 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-30 15:09:15 +00:00
desrosj 856cee1568 Build/Test Tools: Remove the `workflow_run` event from the Slack notification workflow.
The `workflow_run` event was added to restore Slack notifications for older branches (5.8 and older) without having to backport any changes while alternate approaches were explored.

The workflow has been tested and refined as a reusable one in `trunk`, and this approach is superior to the `workflow_run` event in several ways.

Primarily, the `workflow_run` event results in a separate workflow run being created for sending Slack notifications after the completion of each workflow triggered by `push`. When called as a reusable workflow, this does not happen and the additional jobs are instead added to the initial workflow. This makes which jobs are sending notifications for the current workflow more clear, and reduces the amount of noise (less workflow runs overall).

The `workflow_run` event also makes some data available in different ways than `push` events. By removing it, much of the logic within the workflow can be simplified.

See #56095.
Built from https://develop.svn.wordpress.org/trunk@53591


git-svn-id: http://core.svn.wordpress.org/trunk@53179 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-30 14:07:14 +00:00
Sergey Biryukov 78d4db9924 REST API: Use the `integer` type for `page_on_front` and `page_for_posts` options.
This adjusts the newly added options in the settings endpoint to use the `integer` type instead of `number`. Since these are page IDs and are not supposed to be floats, `integer` is the correct type.

Follow-up to [53588].

See #56058.
Built from https://develop.svn.wordpress.org/trunk@53589


git-svn-id: http://core.svn.wordpress.org/trunk@53177 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-29 14:17:16 +00:00
Sergey Biryukov 126de33a0d REST API: Add missing options to the settings endpoint.
This adds the `show_on_front`, `page_on_front`, and `page_for_posts` options to the settings endpoint that were missed during WP 6.0 backports.

Related PR from Gutenberg repository:
* [https://github.com/WordPress/gutenberg/pull/38607 #38607 Page for Posts: Display notice in template panel]

Props Mamaduka, spacedmonkey, gziolo, jameskoster.
See #56058.
Built from https://develop.svn.wordpress.org/trunk@53588


git-svn-id: http://core.svn.wordpress.org/trunk@53176 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-29 13:48:14 +00:00
audrasjb 46eb690e8f Help/About: Typo correction in the Media Library help tab text.
Follow-up to [53586].

Props SergeyBiryukov.
Fixes #55800.

Built from https://develop.svn.wordpress.org/trunk@53587


git-svn-id: http://core.svn.wordpress.org/trunk@53175 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-29 13:39:14 +00:00
audrasjb e170038ca1 Help/About: Add help tab info for available row actions in the Media Library.
This changeset fills the existing help tab with more detailed information about available row actions in the Media Library, when using the List view.

Props kebbet, audrasjb, costdev, SergeyBiryukov, mukesh27.
Fixes #55800.

Built from https://develop.svn.wordpress.org/trunk@53586


git-svn-id: http://core.svn.wordpress.org/trunk@53174 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-28 20:47:11 +00:00
audrasjb d5971fc876 Docs: Misc fixes in Shortcode API function and hook descriptions, as per documentation standards.
See #55646.

Built from https://develop.svn.wordpress.org/trunk@53585


git-svn-id: http://core.svn.wordpress.org/trunk@53173 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-28 20:37:15 +00:00
Sergey Biryukov 98beaad58d Docs: Adjust some DocBlocks in `wpdb` per the documentation standards.
Includes:
* Wrapping long single-line comments to multi-line for better readability.
* Formatting code blocks to display correctly on the Code Reference.
* Other minor edits for consistency.

This applies to:
* `wpdb::$allow_unsafe_unquoted_parameters`
* `wpdb::escape_identifier()`
* `wpdb::_escape_identifier_value()`
* `wpdb::prepare()`
* `wpdb::has_cap()`

Follow-up to [53575].

See #52506, #55646.
Built from https://develop.svn.wordpress.org/trunk@53584


git-svn-id: http://core.svn.wordpress.org/trunk@53172 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-28 11:27:14 +00:00
desrosj f210e677f1 Build/Test Tools: Update the `actions/cache` action.
This correctly updates the `actions/cache` action. [53581] updated the inline comment to the latest version but did not update the actual SHA value correctly.

Follow up to [53581].

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53582


git-svn-id: http://core.svn.wordpress.org/trunk@53171 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-27 19:25:15 +00:00
desrosj 5f51f82e46 Build/Test Tools: Update 3rd party GitHub Actions.
This updates the following GitHub Actions to the latest versions:

- `actions/checkout`
- `actions/cache`
- `actions/github-script`
- `actions/setup-node`
- `codecov/codecov-action`
- `shivammathur/setup-php`
- `slackapi/slack-github-action`

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53581


git-svn-id: http://core.svn.wordpress.org/trunk@53170 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-27 18:58:13 +00:00
desrosj 9930476af2 Build/Test Tools: Update NPM `devDependencies` to their latest versions.
This updates the following `devDependencies` to newer versions:

- `dotenv` from `16.0.0` to `16.0.1`.
- `grunt` from `1.5.2` to `1.5.3`.
- `grunt-contrib-qunit` from `6.0.0` to `6.2.0`.
- `grunt-contrib-uglify` from `5.2.1` to `5.2.2`.
- `qunit` from `2.18.2` to `2.19.1`.
- `sass` from `1.51.0` to `1.53.0`.
- `sinon` from `13.0.2` to `14.0.0`.
- `uglify-js` from `3.15.4` to `3.16.1`.

Additionally, `npm audit fix` has been run to update dependencies with vulnerabilities.

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53580


git-svn-id: http://core.svn.wordpress.org/trunk@53169 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-27 18:53:29 +00:00
Sergey Biryukov 729831b40f General: Revert an earlier define of the `WPINC` constant in `src/index.php`.
This avoids a `Constant WPINC already defined in src/wp-settings.php on line 16` PHP warning, which happens when running a WordPress install out of the `src` directory after `npm run build:dev`.

Add a comment to clarify the check for built assets and the direct mention of `wp-includes`.

Follow-up to [53518].

Props aristath.
See #54233.
Built from https://develop.svn.wordpress.org/trunk@53579


git-svn-id: http://core.svn.wordpress.org/trunk@53168 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-27 10:20:19 +00:00
Sergey Biryukov 79efd59bca Upgrade/Install: Add a conditional to facilitate testing of the Rollbacks feature project.
The [https://make.wordpress.org/core/2021/02/19/feature-plugin-rollback-update-failure/ Rollback Update Failure feature project] creates a temporary backup of plugins and themes before updating. This aims to make the update process more reliable and ensure that if a plugin or theme update fails, the previous version can be safely restored.

If the [https://wordpress.org/plugins/rollback-update-failure/ Rollback Update Failure plugin] is installed, `WP_Upgrader::install_package()` will use the `move_dir()` function from there for better performance. Instead of copying a directory from one location to another, it uses the `rename()` PHP function to speed up the process, which is instrumental in creating a temporary backup without a delay. If the renaming failed, it falls back to `copy_dir()` WP function.

This conditional aims to facilitate broader testing of the feature. It is temporary, until the plugin is merged into core.

Props afragen, pbiron, costdev, davidbaumwald, audrasjb, jrf, SergeyBiryukov.
Fixes #56057. See #51857, #54166.
Built from https://develop.svn.wordpress.org/trunk@53578


git-svn-id: http://core.svn.wordpress.org/trunk@53167 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-26 12:37:18 +00:00
Sergey Biryukov d533b76ef8 Tests: Remove multiple `$wpdb::placeholder_escape()` calls in `wpdb` tests.
This aims to improve performance of the tests by reducing the number of function calls.

Since `$wpdb::placeholder_escape()` saves the result in a static variable on the first run, there is no need for repeated function calls during the same request or test run, as the result would still be the same.

Follow-up to [42056].

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53577


git-svn-id: http://core.svn.wordpress.org/trunk@53166 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-25 14:45:12 +00:00
davidbaumwald c2fbb4950d Comments: Add contextual `autocomplete` attributes to comment form fields.
For accessibility, input fields should identify their "purpose".  The HTML5 attribute `autocomplete` allows for various user data to be quickly autofilled while adding context for some assistive technologies.

This commit adds the appropriate autofill purposes for an author's name, email, and website URL in the comment form template.

Props juliemoynat, bhrugesh96, sabernhardt.
Fixes #55779.
Built from https://develop.svn.wordpress.org/trunk@53576


git-svn-id: http://core.svn.wordpress.org/trunk@53165 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-24 21:26:12 +00:00
davidbaumwald e7a9fe918c Database: Add `%i` placeholder support to `$wpdb->prepare` to escape table and column names.
WordPress does not currently provide an explicit method for escaping SQL table and column names. This leads to potential security vulnerabilities, and makes reviewing code for security unnecessarily difficult.  Also, static analysis tools also flag the queries as having unescaped SQL input.

Tables and column names in queries are usually in-the-raw, since using the existing `%s` will straight quote the value, making the query invalid.

This change introduces a new `%i` placeholder in `$wpdb->prepare` to properly quote table and column names using backticks.

Props tellyworth, iandunn, craigfrancis, peterwilsoncc, johnbillion, apokalyptik.
Fixes #52506.
Built from https://develop.svn.wordpress.org/trunk@53575


git-svn-id: http://core.svn.wordpress.org/trunk@53164 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-24 20:35:14 +00:00
Sergey Biryukov 178bd65605 Tests: Replace `esc_url_raw()` calls with `sanitize_url()`.
Previously committed in [53455], appears to be accidentally reverted in [53562].

Follow-up to [51597], [53452], [53455], [53562].

See #39265, #55652.
Built from https://develop.svn.wordpress.org/trunk@53574


git-svn-id: http://core.svn.wordpress.org/trunk@53163 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-24 15:09:11 +00:00
Sergey Biryukov dc8416e7c2 Tests: Use more consistent wording when referring to PHP deprecation notices.
Previously committed in [53492], appears to be accidentally reverted in [53564].

Follow-up to [51619], [51695], [53492], [53563].

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53573


git-svn-id: http://core.svn.wordpress.org/trunk@53162 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-24 15:04:10 +00:00
Sergey Biryukov d0588e2f1b Tests: Give the tests for adding empty post meta values more consistent names.
One of these was previously renamed to mention `update_metadata_by_mid()`.

While `update_metadata_by_mid()` is indeed called in `wp_ajax_add_meta()` to update an existing meta value, the functionality change that the test intended to verify was in the latter function.

Follow-up to [44153], [53561].

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53572


git-svn-id: http://core.svn.wordpress.org/trunk@53161 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-24 14:43:11 +00:00
Sergey Biryukov 816325b9b8 Tests: Put `@covers` tags before `@params` in Ajax and Formatting groups.
This makes the placement more consistent with the rest of the test suite.

Follow-up to [53561], [53562].

See #39265.
Built from https://develop.svn.wordpress.org/trunk@53571


git-svn-id: http://core.svn.wordpress.org/trunk@53160 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-24 14:20:13 +00:00
Sergey Biryukov 7abd4bc951 Media: Use correct escaping function for URLs in some legacy media functions.
This affects:
* `get_image_send_to_editor()`
* `image_link_input_fields()`

Follow-up to [7092], [7874], [8653], [11109], [11204], [11383], [12051], [12199], [19982].

Props smit08, mukesh27.
Fixes #56064.
Built from https://develop.svn.wordpress.org/trunk@53570


git-svn-id: http://core.svn.wordpress.org/trunk@53159 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-24 13:52:13 +00:00
Sergey Biryukov bb92e303d7 Editor: Add utility classnames back to blocks that have layout attributes specified.
[https://github.com/WordPress/gutenberg/issues/38719 In 5.9 these utility classnames were removed], which removed the ability for theme/plugin authors to assign their own custom CSS related to specific layout selections. This was mostly related to the Button block.

This commit adds these classes dynamically based on attributes, rather than saving them to the serialized content.

Original PR from Gutenberg repository:
* [https://github.com/WordPress/gutenberg/pull/41487 #41487 Add utility classnames back to blocks that have layout attributes specified]

Props glendaviesnz, peterwilsoncc, andrewserong, zieladam, matveb, samikeijonen.
See #56058.
Built from https://develop.svn.wordpress.org/trunk@53568


git-svn-id: http://core.svn.wordpress.org/trunk@53157 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-23 23:09:09 +00:00
audrasjb 9a2ae08812 Application Passwords: Ensure long passwords don't break the "new password" notice.
This changeset adds a `word-wrap: break-word` CSS declaration to avoid text overflow in the "new application password" notice.

Props Presskopp, hasanuzzamanshamim, yannielsen, audrasjb.
Fixes #54581.

Built from https://develop.svn.wordpress.org/trunk@53567


git-svn-id: http://core.svn.wordpress.org/trunk@53156 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-23 23:04:09 +00:00
audrasjb a33fd9fc55 Docs: Use third-person singular verbs for function descriptions in Bookmark related files, as per docblock standards.
This changeset updates `bookmark.php` and `bookmark-template.php` files.

See #55646.

Built from https://develop.svn.wordpress.org/trunk@53566


git-svn-id: http://core.svn.wordpress.org/trunk@53155 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-23 22:57:12 +00:00
Sergey Biryukov a5ab6b8d8b Tests: Correct the expected result for `wp_ajax_replyto_comment()` test with a draft post.
The "Error:" prefix was previously removed and accidentally re-added with `@covers` tags.

Follow-up to [53337], [53561].

See #39265.
Built from https://develop.svn.wordpress.org/trunk@53565


git-svn-id: http://core.svn.wordpress.org/trunk@53154 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-23 21:38:12 +00:00
Andrew Ozz 4c9bf00e9c Build/Test Tools: Add missing @covers tags and fix the docs for the Cron test group.
Props pbeane, hellofromTonya, antonvlasenko, ironprogrammer, SergeyBiryukov, costdev.
See #39265.

Built from https://develop.svn.wordpress.org/trunk@53564


git-svn-id: http://core.svn.wordpress.org/trunk@53153 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-23 20:43:13 +00:00
Andrew Ozz 54ba73b9ca Build/Test Tools: Fix erroneous file name, from `convertInvalidEntries.php` to `convertInvalidEntities.php`.
Props pbeane, hellofromTonya, antonvlasenko, ironprogrammer, SergeyBiryukov, costdev.
See #55652.
Built from https://develop.svn.wordpress.org/trunk@53563


git-svn-id: http://core.svn.wordpress.org/trunk@53152 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-23 20:36:13 +00:00
Andrew Ozz d7b34a5287 Build/Test Tools, Formatting group:
- Add and update @covers tags.
- Add and improve docs and inline comments.

Props pbeane, hellofromTonya, antonvlasenko, ironprogrammer, SergeyBiryukov, costdev.
See #39265.
Built from https://develop.svn.wordpress.org/trunk@53562


git-svn-id: http://core.svn.wordpress.org/trunk@53151 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-23 20:29:09 +00:00
Andrew Ozz c5a5234941 Build/Test Tools: Add missing @covers tags for the AJAX test group.
Props pbeane, hellofromTonya, antonvlasenko, ironprogrammer, SergeyBiryukov, costdev.
See #39265.
Built from https://develop.svn.wordpress.org/trunk@53561


git-svn-id: http://core.svn.wordpress.org/trunk@53150 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-23 19:47:10 +00:00
John Blackbourn 5dd1936fdb Themes: Add actions to template loading to assist with collecting debug info.
This introduces the following new actions which wrap the process of loading a template file:

* `wp_before_load_template`
* `wp_after_load_template`

Props rmccue, tabrisrp, peterwilsoncc

Fixes #54541

Built from https://develop.svn.wordpress.org/trunk@53560


git-svn-id: http://core.svn.wordpress.org/trunk@53149 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-23 18:59:09 +00:00
Aaron Jorbin a457e3498e Editor: Universalize functions for checking block editor status.
`use_block_editor_for_post_type` and `use_block_editor_for_post` can be very useful in more contexts than wp-admin, especially when a site is in transition. For example, you may want to do things on init that are different.

Neither function depends on other functions that are available only in wp-admin (other than use_block_editor_for_post() relying on use_block_editor_for_post_type() and an admin-referrer check that's historically gated by a query variable and now also gated by is_admin), therefore  moving them to wp-includes seems both feasible and beneficial

Props ethitter, jorbin.
Fixes #51819.


Built from https://develop.svn.wordpress.org/trunk@53559


git-svn-id: http://core.svn.wordpress.org/trunk@53148 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-23 18:48:13 +00:00
Sergey Biryukov fe941574c3 Code Modernization: Remove dynamic properties in `Tests_Media`.
Dynamic (non-explicitly declared) properties are deprecated as of PHP 8.2 and are expected to become a fatal error in PHP 9.0.

In this particular case, the test class contains a `set_up()` method that sets a group of properties, which are ''used'' by the tests, but never ''changed'' by the tests.

In other words, setting these properties in the `set_up()` is an unnecessary overhead and the properties should be changed to class constants.

Notes:
* As the `$img_html` property, which was previously being set, is not actually used in any of the tests, that property has not been converted to a constant.
* The values which were previously being set using a heredoc, now use a nowdoc (supported since PHP 5.3), as they don't contain any interpolation.
* The use of constant scalar expressions (`IMG_URL`) and constant arrays (`IMG_META`) in class constants is supported since PHP 5.6.

Follow-up to [711/tests], [1260/tests], [34855], [41724], [53557].

Props jrf.
See #56033.
Built from https://develop.svn.wordpress.org/trunk@53558


git-svn-id: http://core.svn.wordpress.org/trunk@53147 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-23 15:03:15 +00:00
Sergey Biryukov 86865fcbdd Code Modernization: Remove dynamic properties in `Tests_*_Slashes`.
Dynamic (non-explicitly declared) properties are deprecated as of PHP 8.2 and are expected to become a fatal error in PHP 9.0.

In this particular case, the test classes contain a `set_up()` method that sets a group of properties, which are ''used'' by the tests, but the values of these properties are never ''changed'' by the tests.

In other words, setting these properties in the `set_up()` is an unnecessary overhead and the properties should be changed to class constants.

Follow-up to [1041/tests], [1071/tests].

Props jrf.
See #56033.
Built from https://develop.svn.wordpress.org/trunk@53557


git-svn-id: http://core.svn.wordpress.org/trunk@53146 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-23 14:26:13 +00:00
Sergey Biryukov fb93f0ecc1 Tests: Improve the test for sticky posts not being moved to the front in sitemaps.
* Give the test method a most descriptive name.
* Use a single assertion for the URL list instead of a `foreach` loop to provide more context in case of failure.
* Add a failure message to each assertion, as there are multiple assertions used in the test.

Follow-up to [53548].

See #55633.
Built from https://develop.svn.wordpress.org/trunk@53556


git-svn-id: http://core.svn.wordpress.org/trunk@53145 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-22 16:52:11 +00:00
Sergey Biryukov 5d2e8afebd Code Modernization: Use the integer portion of an item position in `add_submenu_page()`.
This fixes an `Implicit conversion from float to int loses precision` PHP 8.1 deprecation notice when adding a new admin menu item with a `float` value passed as the `$position` parameter.

This change is covered by existing unit tests and addresses 8 errors when running the test suite on PHP 8.1.

References:
* [https://php.watch/versions/8.1/deprecate-implicit-conversion-incompatible-float-string PHP 8.1: Implicit incompatible float to int conversion is deprecated]
* [https://wiki.php.net/rfc/implicit-float-int-deprecate PHP RFC: Deprecate implicit non-integer-compatible float to int conversions]

Follow-up to [52569], [53104].

Props jrf.
See #55656, #54798.
Built from https://develop.svn.wordpress.org/trunk@53555


git-svn-id: http://core.svn.wordpress.org/trunk@53144 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-22 14:55:11 +00:00
desrosj 9e3dc52d45 Build/Test Tools: Return an error when uploading a test coverage report fails.
`true` is now passed to the `fail_ci_if_error` input when the `codecov/codecov-action` action is used.

When uploading a code coverage report is unsuccessful, the action will now fail and return an error. This will help avoid situations like #56022 where the report was suddenly failing to upload even though the workflow itself appeared to be successful.

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53554


git-svn-id: http://core.svn.wordpress.org/trunk@53143 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-22 00:20:11 +00:00
desrosj 5aae4a4c10 Build/Test Tools: Allow changes to the code coverage workflow to run on pull request.
This adds the `pull_request` event to the Code Coverage Report workflow, allowing changes to be verified in a pull request before being committed.

The `branches` and `paths` filters are used to limit when the workflow runs to pull requests with:

- A base branch of `trunk`.
- Changing specific files that can potentially affect the way a coverage report is generated.

Reports generated on `pull_request` events are for testing purposes only and are not submitted to Codecov.

The `docker-compose.yml` file has also been added to the `paths` filter for both `push` and `pull_request` events. Changes to this file could potentially affect the environment used to generate the report (such as the ones in [53552]).

Props afragen, johnbillion, desrosj.
See #55652.
Built from https://develop.svn.wordpress.org/trunk@53553


git-svn-id: http://core.svn.wordpress.org/trunk@53142 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-22 00:01:13 +00:00
desrosj df27445253 Build/Test Tools: Configure Xdebug modes in the local Docker environment.
One change in the update from Xdebug version 2.x to 3.x was a shift from enabling features to switching into modes.

When the version of Xdebug installed in the PHP 7.4 Docker container was updated from 2.x to 3.x, the code coverage reporting workflow stopped generating reports due to a lack of available coverage drivers.

This change adds the `XDEBUG_MODE` environment variable to the local Docker environment configuration to allow the active modes to be changed. This environment variable takes precedence over the `xdebug.mode` setting, but will not change the value of the `xdebug.mode` setting.

The `LOCAL_PHP_XDEBUG_MODE` environment variable has been added to the `.env` file and can be used to change the modes enabled in the Docker container. The code coverage reporting workflow uses this variable to enable the `coverage` mode, which is required for generating a test coverage report.

By default, `debug` and `debug modes are active, which enables the more commonly used features of Xdebug: development helpers and step debugging.

Props afragen, johnbillion, desrosj.
Fixes #56022.
Built from https://develop.svn.wordpress.org/trunk@53552


git-svn-id: http://core.svn.wordpress.org/trunk@53141 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-21 23:47:13 +00:00
audrasjb 29cfbec0ba Docs: Add missing `@since` mention in `get_posts_query_args()`.
Follow-up to [53548].
See #55633.

Built from https://develop.svn.wordpress.org/trunk@53551


git-svn-id: http://core.svn.wordpress.org/trunk@53140 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-21 13:48:12 +00:00
audrasjb d3cf4fb243 Docs: Use third-person singular verbs for function descriptions in `Tests_Sitemaps_wpSitemapsPosts`, as per docblock standards.
See #55646.

Built from https://develop.svn.wordpress.org/trunk@53550


git-svn-id: http://core.svn.wordpress.org/trunk@53139 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-21 13:45:09 +00:00
spacedmonkey ac6ce3e026 Posts, Post Types: Add caching to `_find_post_by_old_slug` and `_find_post_by_old_date` functions.
Cache result of database queries in `_find_post_by_old_slug` and `_find_post_by_old_date` functions. This means that repeated requests to a url where the page is not found, will result in hitting a cache for sites running persistent object caching. 

Props Spacedmonkey, dd32, mukesh27, pbearne, flixos90.
Fixes #36723.
Built from https://develop.svn.wordpress.org/trunk@53549


git-svn-id: http://core.svn.wordpress.org/trunk@53138 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-21 13:34:13 +00:00
audrasjb ea5c6469c9 Sitemaps: Remove duplicate sticky Posts from Sitemap Post Query.
This changeset sets the `ignore_sticky_posts` parameter to `true` in the default arguments passed to `wp_sitemaps_posts_query_args`.

Props RavanH, pbiron, swissspidy, audrasjb, SergeyBiryukov.
Fixes #55633.

Built from https://develop.svn.wordpress.org/trunk@53548


git-svn-id: http://core.svn.wordpress.org/trunk@53137 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-21 13:18:10 +00:00
Sergey Biryukov b8290da037 Docs: Improve documentation for `WP_Image_Editor::save()` and related functions.
Includes:
* Documenting the returned array using hash notation.
* Adding a `@since` note for the `$filesize` value being included in the returned array.

This affects:
 * `wp_generate_attachment_metadata()`
 * `wp_get_attachment_metadata()`
 * `WP_Image_Editor::save()`
 * `WP_Image_Editor_GD::save()` and `::_save()`
 * `WP_Image_Editor_Imagick::save()` and `::_save()`

Follow-up to [22094], [22619], [52837], [53546].

See #55646.
Built from https://develop.svn.wordpress.org/trunk@53547


git-svn-id: http://core.svn.wordpress.org/trunk@53136 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-21 11:18:17 +00:00
Sergey Biryukov b352d32d8a Docs: Correct the return type for `wp_save_image_file()`.
Since WordPress 3.5, `wp_save_image_file()` uses `WP_Image_Editor` classes under the hood to save the images.

While the `save()` method in those instances returns `array|WP_Error` and is documented as such, the return type of the `wp_save_image_file()` function was still left as `bool`.

A better solution would be to adjust the function to return the documented boolean type. However, doing that after 20+ major WP releases would be a backward compatibility break, so the documentation is now updated instead.

Includes:
* Documenting the returned array using hash notation.
* Adding a `@since` note for the `$image` parameter expecting a `WP_Image_Editor` instance.
* Adding a `@since` note for the `$filesize` value being included in the returned array.

Follow-up to [22094], [22619], [52837].

Props jrf, SergeyBiryukov.
See #55646.
Built from https://develop.svn.wordpress.org/trunk@53546


git-svn-id: http://core.svn.wordpress.org/trunk@53135 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-21 11:16:17 +00:00
Sergey Biryukov f8e00d59ae Tests: Move `assertQueryTrue()` closer to the other custom assertions in `WP_UnitTestCase_Base`.
Follow-up to [109/tests], [26005].

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53545


git-svn-id: http://core.svn.wordpress.org/trunk@53134 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-21 11:14:22 +00:00
spacedmonkey 65b78390ee REST API: Move all links to prepare_links method in theme REST API controller.
Move logic to generate link to global styles to the `prepare_links` method in theme REST API controller. This way all logic to generate links is within the `prepare_links` method, bringing this controller inline with other REST API controllers.

Props SergeyBiryukov, Spacedmonkey.
Fixes #56018.
Built from https://develop.svn.wordpress.org/trunk@53544


git-svn-id: http://core.svn.wordpress.org/trunk@53133 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-21 10:48:21 +00:00
John Blackbourn 721877d3d2 I18N: Correct and improve inline docs and tests for functionality related to nooped plurals.
See #55646, #55652

Built from https://develop.svn.wordpress.org/trunk@53543


git-svn-id: http://core.svn.wordpress.org/trunk@53132 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-20 22:57:16 +00:00
Sergey Biryukov a07f85a464 Docs: Use third-person singular verbs for function descriptions in `Tests_Image_Functions`, per the documentation standards.
See #55646.
Built from https://develop.svn.wordpress.org/trunk@53542


git-svn-id: http://core.svn.wordpress.org/trunk@53131 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-20 22:26:16 +00:00
Sergey Biryukov db04949ca0 Tests: Further improve `Tests_Image_Functions::test_wp_crop_image*()` tests.
Includes:
* Making the test method names more specific.
* Converting one-off helper methods to static closures.
* Adding a failure message to each assertion when multiple assertions are used in the test.

Follow-up to [1126/tests], [1201/tests], [53292], [53495], [53522], [53538].

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53541


git-svn-id: http://core.svn.wordpress.org/trunk@53130 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-20 22:06:18 +00:00
audrasjb 78bc43e7f8 Embeds: Remove Meetup as an oEmbed source since the related endpoint has been deprecated.
This changeset removes Meetup as an oEmbed source, since Meetup.com have deprecated their oEmbed endpoint. The block has already been removed from the editor, see GB#35085.

Props peterwilsoncc, audrasjb, swissspidy.
Fixes #55997.

Built from https://develop.svn.wordpress.org/trunk@53540


git-svn-id: http://core.svn.wordpress.org/trunk@53129 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-20 21:48:15 +00:00
audrasjb fa3ed002e1 Docs: Use third-person singular verbs for function descriptions in the Feed API, as per docblock standards.
See #55646.

Built from https://develop.svn.wordpress.org/trunk@53539


git-svn-id: http://core.svn.wordpress.org/trunk@53128 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-20 21:46:16 +00:00
Sergey Biryukov 30836ec0bd Tests: Improve `Tests_Image_Functions::test_wp_crop_image*()` tests.
Includes:
* Adding `@covers` annotations.
* Adding a failure message to each assertion when multiple assertions are used in the test.

Follow-up to [1126/tests], [53495], [53497], [53521], [53523], [53524], [53525], [53526], [53529], [53530], [53531], [53537].

Props jrf.
See #55652.
Built from https://develop.svn.wordpress.org/trunk@53538


git-svn-id: http://core.svn.wordpress.org/trunk@53127 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-20 21:37:15 +00:00
Sergey Biryukov 26561d6b94 Tests: Refactor `Tests_Image_Functions::test_load_directory()` to split the tests and use a data provider.
This one test was testing three different situations. When one assertion fails, the rest of the test would not be executed, so this leads to hiding one error behind another.

Splitting the test into three distinct test methods still allows for testing each situation, but tests each one in isolation and won't hide errors.

The third part of the test, dealing with image editor engine classes, will also now use a data provider.

Using a data provider has a number of advantages:
1. If the first test case fails, it won't prevent the other test cases from being tested.
2. The output from PHPUnit will be more descriptive in case of failure when using a data provider.
3. Using named test cases in the data provider will also make the `--testdox` output much more descriptive and informative.

The actual cases being tested, or the test itself have not been changed.

Includes:
* Adding `@covers` annotations.
* Adding a failure message to each assertion when multiple assertions are used in the test.
* Reusing an existing data provider with the available image editor engine classes.

Follow-up to [1061/tests], [53495], [53497], [53521], [53523], [53524], [53525], [53526], [53529], [53530], [53531].

Props jrf.
See #55652.
Built from https://develop.svn.wordpress.org/trunk@53537


git-svn-id: http://core.svn.wordpress.org/trunk@53126 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-20 19:36:20 +00:00
Sergey Biryukov 306f53a798 Tests: Always include the error message in `assertNotWPError()` and `assertNotIXRError()`.
Previously, in case of failure, `WP_UnitTestCase_Base::assertNotWPError()` displayed the actual error message from the passed `WP_Error` object, but only if the `$message` parameter was empty.

This made the assertion less helpful, as the actual error message was lost in case there was a non-empty `$message` parameter passed to the method, as per the [https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#using-assertions Writing PHP Tests] guidelines:
> All PHPUnit assertions, as well as all WordPress custom assertions, allow for a `$message` parameter to be passed. This message will be displayed when the assertion fails and can help immensely when debugging a test. This parameter should always be used if more than one assertion is used in a test method.

This commit ensures that the actual error message is always displayed, in addition to the passed `$message` parameter.

The same applies to `WP_UnitTestCase_Base::assertNotIXRError()`.

Follow-up to [34638], [40417].

Props jrf, SergeyBiryukov.
See #55652.
Built from https://develop.svn.wordpress.org/trunk@53536


git-svn-id: http://core.svn.wordpress.org/trunk@53125 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-20 17:29:17 +00:00
Sergey Biryukov 75f689766f External Libraries: Upgrade PHPMailer to version 6.6.3.
This is a maintenance release with minor CS improvements.

Release notes:
https://github.com/PHPMailer/PHPMailer/releases/tag/v6.6.3

For a full list of changes in this update, see the PHPMailer GitHub:
https://github.com/PHPMailer/PHPMailer/compare/v6.6.2...v6.6.3

Follow-up to [50628], [50799], [51169], [51634], [51635], [52252], [52749], [52811], [53500].

Props jrf, Synchro.
Fixes #56016.
Built from https://develop.svn.wordpress.org/trunk@53535


git-svn-id: http://core.svn.wordpress.org/trunk@53124 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-20 15:04:11 +00:00
desrosj cb93e6ba63 Build/Test Tools: Adjust Slack notifications logic to account for expected non `push` events.
This adjusts the logic used to determine the outcome of the previous workflow run of the current one to account for `schedule` and `workflow_dispatch` events.

In the current state, only workflows triggered by `push` events are examined. This is causing failures when trying to post Slack notifications for the Test Coverage workflow, and inconsistent results for `workflow_dispatch` events when testing older branches on a schedule.

Follow up to [53466] and [53468].
See #55652.
Built from https://develop.svn.wordpress.org/trunk@53534


git-svn-id: http://core.svn.wordpress.org/trunk@53123 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-20 15:00:15 +00:00
Sergey Biryukov 5b4e5235ed Tests: Use consistent punctuation in failure messages in `Tests_Image_Functions`.
Follow-up to [53523], [53524], [53525], [53526], [53529], [53530], [53531].

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53533


git-svn-id: http://core.svn.wordpress.org/trunk@53122 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-20 12:50:14 +00:00
Sergey Biryukov 162bffa8b5 Tests: Consistently check that an image was loaded in image saving tests.
Don't unnecessarily load the image twice in `test_inferred_mime_types_when_saving_an_image()`.

Follow-up to [1061/tests], [1151/tests], [1157/tests], [29834].

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53532


git-svn-id: http://core.svn.wordpress.org/trunk@53121 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-19 17:28:11 +00:00
Sergey Biryukov 5f344cee00 Tests: Refactor `Tests_Image_Functions::test_inferred_mime_types()` to use a data provider.
Using a data provider has a number of advantages:
1. If the first test case fails, it won't prevent the other test cases from being tested.
2. The output from PHPUnit will be more descriptive in case of failure when using a data provider.
3. Using named test cases in the data provider will also make the `--testdox` output much more descriptive and informative.

The actual cases being tested, or the test itself have not been changed.

Includes:
* Adding a `@covers` annotation.
* Adding a failure message to each assertion.
* Adding a skip annotation for unsupported mime types.
* Making the test method name more specific.

Follow-up to [1061/tests], [53495], [53497], [53521], [53523], [53524], [53525], [53526], [53529], [53530].

Props jrf.
See #55652.
Built from https://develop.svn.wordpress.org/trunk@53531


git-svn-id: http://core.svn.wordpress.org/trunk@53120 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-19 17:12:07 +00:00
Sergey Biryukov 13b24017be Tests: Refactor `Tests_Image_Functions::test_mime_overrides_filename()` to use a data provider.
Using a data provider has a number of advantages:
1. If the first test case fails, it won't prevent the other test cases from being tested.
2. The output from PHPUnit will be more descriptive in case of failure when using a data provider.
3. Using named test cases in the data provider will also make the `--testdox` output much more descriptive and informative.

The actual cases being tested, or the test itself have not been changed.

Includes:
* Adding a `@covers` annotation.
* Adding a failure message to each assertion.
* Making the test method name more specific.

Follow-up to [1061/tests], [53495], [53497], [53521], [53523], [53524], [53525], [53526], [53529].

Props jrf.
See #55652.
Built from https://develop.svn.wordpress.org/trunk@53530


git-svn-id: http://core.svn.wordpress.org/trunk@53119 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-19 16:53:08 +00:00
Sergey Biryukov de017e6a7e Tests: Refactor `Tests_Image_Functions::test_wp_save_image_file()` to use a data provider.
Using a data provider has a number of advantages:
1. If the first test case fails, it won't prevent the other test cases from being tested.
2. The output from PHPUnit will be more descriptive in case of failure when using a data provider.
3. Using named test cases in the data provider will also make the `--testdox` output much more descriptive and informative.

The actual cases being tested, or the test itself have not been changed.

Includes:
* Adding a `@covers` annotation.
* Adding a skip annotation for unsupported mime types.
* Adding a failure message to each assertion.

Follow-up to [1061/tests], [53495], [53497], [53521], [53523], [53524], [53525], [53526].

Props jrf.
See #55652.
Built from https://develop.svn.wordpress.org/trunk@53529


git-svn-id: http://core.svn.wordpress.org/trunk@53118 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-19 16:41:12 +00:00
Sergey Biryukov 3abb5d4a83 Tests: Reorder `is_gd_image()` test methods for consistency.
This moves the test for valid types first, to match `file_is_valid_image()` and `file_is_displayable_image()` tests.

Follow-up to [48798], [53527].

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53528


git-svn-id: http://core.svn.wordpress.org/trunk@53117 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-19 16:05:09 +00:00
Sergey Biryukov b01fc042dc Tests: Rename some test methods in `Tests_Image_Functions` for consistency.
This matches the names of the functions being tested:
* `file_is_valid_image()`
* `file_is_displayable_image()`

Follow-up to [184/tests], [53523], [53524], [53525], [53526].

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53527


git-svn-id: http://core.svn.wordpress.org/trunk@53116 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-19 15:45:13 +00:00
Sergey Biryukov d53738ce7c Tests: Refactor `Tests_Image_Functions::test_is_displayable_image_negative()` to use a data provider.
Using a data provider has a number of advantages:
1. If the first test case fails, it won't prevent the other test cases from being tested.
2. While the assertion used in this test method ''does'' have a "failure message" (👍), the output from PHPUnit itself will already be more descriptive in case of failure when using a data provider.
3. Using named test cases in the data provider will also make the `--testdox` output much more descriptive and informative.

The actual cases being tested, or the test itself have not been changed.

Includes:
* Adding a `@covers` annotation.

Follow-up to [184/tests], [53495], [53497], [53521], [53523], [53524], [53525].

Props jrf.
See #55652.
Built from https://develop.svn.wordpress.org/trunk@53526


git-svn-id: http://core.svn.wordpress.org/trunk@53115 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-19 15:36:11 +00:00
Sergey Biryukov 40abfe84c7 Tests: Refactor `Tests_Image_Functions::test_is_displayable_image_positive()` to use a data provider.
Using a data provider has a number of advantages:
1. If the first test case fails, it won't prevent the other test cases from being tested.
2. While the assertion used in this test method ''does'' have a "failure message" (👍), the output from PHPUnit itself will already be more descriptive in case of failure when using a data provider.
3. Using named test cases in the data provider will also make the `--testdox` output much more descriptive and informative.

The actual cases being tested, or the test itself have not been changed.

Includes:
* Changing the conditional addition of the `.ico` file type to be unconditional, it was only needed for PHP < 5.3.
* Adding a `@covers` annotation.

Follow-up to [184/tests], [42780], [53495], [53497], [53521], [53523], [53524].

Props jrf.
See #55652.
Built from https://develop.svn.wordpress.org/trunk@53525


git-svn-id: http://core.svn.wordpress.org/trunk@53114 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-19 15:30:08 +00:00
Sergey Biryukov 3d4dce5320 Tests: Refactor `Tests_Image_Functions::test_is_image_negative()` to use a data provider.
Using a data provider has a number of advantages:
1. If the first test case fails, it won't prevent the other test cases from being tested.
2. While the assertion used in this test method ''does'' have a "failure message" (👍), the output from PHPUnit itself will already be more descriptive in case of failure when using a data provider.
3. Using named test cases in the data provider will also make the `--testdox` output much more descriptive and informative.

The actual cases being tested, or the test itself have not been changed.

Includes:
* Adding a `@covers` annotation.

Follow-up to [184/tests], [53495], [53497], [53521], [53523].

Props jrf.
See #55652.
Built from https://develop.svn.wordpress.org/trunk@53524


git-svn-id: http://core.svn.wordpress.org/trunk@53113 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-19 15:21:08 +00:00
Sergey Biryukov 35bb74740a Tests: Refactor `Tests_Image_Functions::test_is_image_positive()` to use a data provider.
Using a data provider has a number of advantages:
1. If the first test case fails, it won't prevent the other test cases from being tested.
2. While the assertion used in this test method ''does'' have a "failure message" (👍), the output from PHPUnit itself will already be more descriptive in case of failure when using a data provider.
3. Using named test cases in the data provider will also make the `--testdox` output much more descriptive and informative.

The actual cases being tested, or the test itself have not been changed.

Includes:
* Changing the conditional addition of the `.ico` file type to be unconditional, it was only needed for PHP < 5.3.
* Adding a `@covers` annotation.

Follow-up to [184/tests], [42780], [53495], [53497], [53521].

Props jrf.
See #55652.
Built from https://develop.svn.wordpress.org/trunk@53523


git-svn-id: http://core.svn.wordpress.org/trunk@53112 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-19 15:15:08 +00:00
Sergey Biryukov 3183f77ce7 Tests: Move the `filter_image_editor_output_format()` helper method next to the test it's used in.
Follow-up to [53292], [53495].

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53522


git-svn-id: http://core.svn.wordpress.org/trunk@53111 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-19 12:49:12 +00:00
Sergey Biryukov 6e12ff3b89 Tests: Add a helper method for for creating named data providers in `WP_UnitTestCase_Base`.
This introduces a new test helper function which allows for turning a single-level array containing text strings into a data provider with named data sets, where the value of the data set will also be used as the name of the data set.

The function contains safeguards to ensure that it is only used with data compatible with this principle and will throw generic PHP exceptions when the data is incompatible. These type of exceptions will be displayed before the tests even start running and will stop the test run when they occur.

While generally speaking, all test cases ''should'' extend the base `WP_UnitTestCase_Base` class, this is still made a `public static` method to allow for a test, which by exception directly extends the PHPUnit base `TestCase` or the `PHPUnit_Adapter_TestCase`, to also be able to use this method.

Typical usage of this method:
{{{
public function data_provider_for_test_name() {
	$array = array(
		'value1',
		'value2',
	);

	return $this->text_array_to_dataprovider( $array );
}
}}}
The returned result will look like:
{{{
array(
	'value1' => array( 'value1' ),
	'value2' => array( 'value2' ),
)
}}}

Props jrf, hellofromTonya, adamsilverstein.
See #55652.
Built from https://develop.svn.wordpress.org/trunk@53521


git-svn-id: http://core.svn.wordpress.org/trunk@53110 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-18 21:30:13 +00:00
Sergey Biryukov 481da1b9f4 Docs: Consistently declare the `$wp_query` global in link template functions.
This ensures that the global is explicitly declared and documented in:
* `get_next_posts_link()`
* `get_posts_nav_link()`
* `get_the_posts_navigation()`
* `get_the_posts_pagination()`
* `get_next_comments_link()`

Follow-up to [30065].

Props mt8.biz, sabernhardt.
Fixes #43164.
Built from https://develop.svn.wordpress.org/trunk@53520


git-svn-id: http://core.svn.wordpress.org/trunk@53109 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-18 15:38:15 +00:00
Sergey Biryukov c70a5c547f Coding Standards: Fix WPCS issue in [53518].
This fixes an "Concat operator must be surrounded by a single space" error.

See #54233.
Built from https://develop.svn.wordpress.org/trunk@53519


git-svn-id: http://core.svn.wordpress.org/trunk@53108 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-17 11:33:08 +00:00
Sergey Biryukov a0215f6e9d General: Use `WPINC` as a shorter reference to `wp-includes` in some files.
This brings more consistency with similar `require_once` statements and `_deprecated_file()` calls in other files.

Follow-up to [601], [628], [36693], [44359], [45663], [45678], [52026], 

Props malthert.
See #54233.
Built from https://develop.svn.wordpress.org/trunk@53518


git-svn-id: http://core.svn.wordpress.org/trunk@53107 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-17 11:20:13 +00:00
audrasjb 4947604b66 Twenty Twenty-One: Ensure custom text color is reflected in the Editor for Quote block.
This changes removes an hardcoded CSS color value for the Quote block in Twenty Twenty-One's editor stylesheet. This ensures custom text color is fully reflected in the Editor for Quote block.

Props jyolsna, evildon, kajalgohel, audrasjb.
Fixes #55989.

Built from https://develop.svn.wordpress.org/trunk@53517


git-svn-id: http://core.svn.wordpress.org/trunk@53106 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-16 23:43:09 +00:00
audrasjb bac638e610 Docs: Use third-person singular verbs for function descriptions in the Taxonomy Administration API.
See #55646.

Built from https://develop.svn.wordpress.org/trunk@53516


git-svn-id: http://core.svn.wordpress.org/trunk@53105 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-16 23:39:08 +00:00
audrasjb cfd6d327ad Twenty Nineteen: Ensure custom text color is reflected in the Editor for Quote block.
This changes removes an hardcoded CSS color value for the Quote block in Twenty Nineteen's editor stylesheet. This ensures custom text color is fully reflected in the Editor for Quote block.

Props nithi22, evildon, SergeyBiryukov, audrasjb.
Fixes #55992.

Built from https://develop.svn.wordpress.org/trunk@53515


git-svn-id: http://core.svn.wordpress.org/trunk@53104 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-16 23:17:08 +00:00
audrasjb 8ea403e9bb Docs: Use third-person singular verbs for function descriptions in the `WP_Screen` API.
See #55646.

Built from https://develop.svn.wordpress.org/trunk@53514


git-svn-id: http://core.svn.wordpress.org/trunk@53103 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-16 23:10:10 +00:00
Sergey Biryukov 2a1e9e1dd8 Docs: Add `@since` notes for `html5` theme feature changes in `add_theme_support()`:
* As of WordPress 3.6.1, the `html5` feature requires an array of types to be passed. Defaults to `comment-list`, `comment-form`, `search-form` for backward compatibility.
* As of WordPress 6.0, the previously added `_doing_it_wrong()` notice is actually displayed as expected.

Follow-up to [25193], [25235], [25785], [49344], [49354], [52828].

Props bobbingwide.
See #51657, #55646.
Built from https://develop.svn.wordpress.org/trunk@53513


git-svn-id: http://core.svn.wordpress.org/trunk@53102 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-16 15:21:15 +00:00
spacedmonkey e5e61f3095 Tests: Re-enable failing REST API test for `update_post_parent_caches()`.
Ensure that that attachment objects are not primed in cache so that test passes when object caching is enabled. 

Follow-up to [53506].

Props SergeyBiryukov.
See #55593.
Built from https://develop.svn.wordpress.org/trunk@53512


git-svn-id: http://core.svn.wordpress.org/trunk@53101 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-15 19:34:12 +00:00
Sergey Biryukov cbca7c4fb9 Tests: Temporarily disable the failing REST API test for `update_post_parent_caches()`.
This needs more investigation to address the test failure with persistent object cache.

Follow-up to [53506].

Props hellofromTonya.
See #55593.
Built from https://develop.svn.wordpress.org/trunk@53511


git-svn-id: http://core.svn.wordpress.org/trunk@53100 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-15 15:39:08 +00:00
Sergey Biryukov 0c2ced37c3 Tests: Use `assertSameSets()` in some newly introduced tests.
This ensures that not only the array values being compared are equal, but also that their type is the same.

Going forward, stricter type checking by using `assertSameSets()` or `assertSameSetsWithIndex()` should generally be preferred, to make the tests more reliable.

Follow-up to [48939], [51137], [51943], [53499], [53504], [53506], [53509].

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53510


git-svn-id: http://core.svn.wordpress.org/trunk@53099 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-15 14:44:11 +00:00
Sergey Biryukov 43f0f88b15 Tests: Some improvements for REST API cache priming tests:
* Give the test methods more specific names and move them closer together.
* Correct the `@covers` tags.

Follow-up to [53499], [53504], [53506], [53507], [53508].

See #55593, #55652.
Built from https://develop.svn.wordpress.org/trunk@53509


git-svn-id: http://core.svn.wordpress.org/trunk@53098 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-15 14:09:08 +00:00
Sergey Biryukov a42b89fc71 REST API: Some documentation and test improvements for `update_menu_item_cache()`:
* Make the function description more specific, for consistency with other similar functions.
* Add a `@since` note for the `$update_menu_item_cache` parameter of `WP_Query::parse_query()`.
* Add missing `@covers` tags for the unit tests.

Follow-up to [53504].

See #55620.
Built from https://develop.svn.wordpress.org/trunk@53508


git-svn-id: http://core.svn.wordpress.org/trunk@53097 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-15 13:37:10 +00:00
Sergey Biryukov 84a8194200 REST API: Some documentation and test improvements for `update_post_parent_caches()`:
* Make the function description more specific, for consistency with `update_post_author_caches()`.
* Add missing `@covers` tags for the unit test.

Follow-up to [53506].

See #55593.
Built from https://develop.svn.wordpress.org/trunk@53507


git-svn-id: http://core.svn.wordpress.org/trunk@53096 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-15 13:19:10 +00:00
spacedmonkey 2c8a6170af REST API: Prime caches for post parents in post REST API controller.
Prime caches for all post parents in the post REST API controller using the `_prime_post_caches` function. Post parent objects are required as part of the `check_read_permission` method’s permission check in post REST API controller. 

Props spacedmonkey, furi3r, peterwilsoncc, mitogh, madpixels. 
Fixes #55593.
Built from https://develop.svn.wordpress.org/trunk@53506


git-svn-id: http://core.svn.wordpress.org/trunk@53095 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-15 10:43:10 +00:00
Sergey Biryukov ab5cc35046 Database: Don't translate the "WordPress database error" message in the error log.
When using multilingual websites, this string could end up with multiple different translations in the error log, making it less actionable.

Unlike errors displayed to the user, a general consensus for software is that errors in logs should always be in English. Since MySQL errors are also returned in English, this brings more consistency to the logs.

Follow-up to [6391], [8168], [19760].

Props malthert.
Fixes #53125.
Built from https://develop.svn.wordpress.org/trunk@53505


git-svn-id: http://core.svn.wordpress.org/trunk@53094 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-15 10:36:09 +00:00
spacedmonkey 991acc48d4 REST API: Prime caches for linked objects in menu item REST API controller.
Add a new parameter to `WP_Query` called `update_menu_item_cache` that when set to true, primes the caches for linked terms and posts for menu item post objects. This change moves logic 
found in `wp_get_nav_menu_items` into a new function called `update_menu_item_cache`.  Update the menu item REST API controller, to pass the `update_menu_item_cache` parameter to the 
arguments used for the  `WP_Query` run to get menu items. 

Props furi3r,  TimothyBlynJacobs, spacedmonkey, peterwilsoncc, mitogh.
Fixes #55620.

 --This line, and those below, will be ignored--

M    src/wp-includes/class-wp-query.php
M    src/wp-includes/nav-menu.php
M    src/wp-includes/rest-api/endpoints/class-wp-rest-menu-items-controller.php
M    tests/phpunit/tests/post/nav-menu.php

Built from https://develop.svn.wordpress.org/trunk@53504


git-svn-id: http://core.svn.wordpress.org/trunk@53093 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-15 10:20:13 +00:00
Sergey Biryukov 73a2d87eae Docs: Add a comment for stripping the leading `AND` from SQL clauses in some query classes.
Follow-up to [30084], [34529], [34542], [36598], [37477], [37572], [43010].

See #55646.
Built from https://develop.svn.wordpress.org/trunk@53503


git-svn-id: http://core.svn.wordpress.org/trunk@53092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-14 16:17:08 +00:00
Sergey Biryukov cacf46f12b Docs: Add a missing word in `pre_months_dropdown_query` filter description.
Follow-up to [50163].

See #55646.
Built from https://develop.svn.wordpress.org/trunk@53502


git-svn-id: http://core.svn.wordpress.org/trunk@53091 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-14 15:07:10 +00:00
Sergey Biryukov 3f74637dfe I18N: Use a translatable string for displaying a user's first name and last name.
That allows locales to switch the order of the first name and last name, should they prefer to do so.

The string was previously used in `wp_insert_user()` and is now reused in other places for consistency:

* `WP_MS_Users_List_Table::column_name()`​
* `WP_Users_List_Table::column_name()​`
* `wp_list_authors()`
* `wp_list_users()`

Note: This also removes the `wp_list_author_full_name` filter, introduced for the same purpose in `wp_list_authors()`, as redundant for now.

Follow-up to [53486].

See #17025.
Built from https://develop.svn.wordpress.org/trunk@53501


git-svn-id: http://core.svn.wordpress.org/trunk@53090 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-14 14:43:12 +00:00
desrosj cc05e7b608 External Libraries: Upgrade PHPMailer to version 6.6.2.
Release notes: https://github.com/PHPMailer/PHPMailer/releases/tag/v6.6.2.

For a full list of changes in this update, see the PHPMailer GitHub: https://github.com/PHPMailer/PHPMailer/compare/v6.6.0...v6.6.2.

Props ayeshrajans, jrf.
Fixes #55976.
Built from https://develop.svn.wordpress.org/trunk@53500


git-svn-id: http://core.svn.wordpress.org/trunk@53089 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-14 14:38:10 +00:00
spacedmonkey 77f62c11db REST API: Prime caches for featured images in post controller.
Ensure that featured image caches are primed for post collections in the post REST API controller, by calling the `update_post_thumbnail_cache` function. 

Props Spacedmonkey, TimothyBlynJacobs, mitogh.
Fixes #55592. 


Built from https://develop.svn.wordpress.org/trunk@53499


git-svn-id: http://core.svn.wordpress.org/trunk@53088 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-14 13:10:10 +00:00
spacedmonkey 7df9ba26b2 REST API: Avoid duplicated query in post collections.
Avoid duplicated query when retrieving empty posts collections by adding a check if the page is more than 1. 

Props furi3r, gdetassigny, TimothyBlynJacobs, spacedmonkey. 
Fixes #55677.


Built from https://develop.svn.wordpress.org/trunk@53498


git-svn-id: http://core.svn.wordpress.org/trunk@53087 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-14 12:42:10 +00:00
Sergey Biryukov c7ab92451a Tests: Remove redundant skip call in `Tests_Image_Functions::get_image_editor_engine_classes()`.
The test bootstrap requires GD to be available, so this test skip condition will never be matched.

Also, test skipping from within a helper method, which may be used in a data provider, can lead to test runtime errors.

Follow-up to [49009], [49014], [49535], [49571], [51415].

Props jrf.
See #55652.
Built from https://develop.svn.wordpress.org/trunk@53497


git-svn-id: http://core.svn.wordpress.org/trunk@53086 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-14 11:46:09 +00:00
spacedmonkey 47a8b2f5de Taxonomy: Fix caching issues in `WP_Term_Query` class.
Introduced [52836] when passing `child_of` or `pad_counts` parameters to `get_terms` or `WP_Term_Query` class, the array of terms received by the query, was not correctly cached. This 
change simplifies the logic in `WP_Term_Query` and ensures terms are correctly cached. This change also, improves performance, by only caching an array of term ids where possible.  

Props denishua, spacedmonkey, oztaser, peterwilsoncc, SergeyBiryukov, georgestephanis, jnz31, knutsp, mukesh27, costdev.
Fixes #55837.


Built from https://develop.svn.wordpress.org/trunk@53496


git-svn-id: http://core.svn.wordpress.org/trunk@53085 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-14 11:43:13 +00:00
Sergey Biryukov e3e0bb1183 Tests: Move helper functions in `Tests_Image_Functions` to more appropriate places.
* Move a non-test specific helper function used by multiple tests up to the top of the class to make it more easily discoverable.
* Move a test-specific helper function used by only one test to be directly below the test using the helper function and make the link with the test explicit by adding a `@see` tag.

Follow-up to [1201/tests], [51415].

Props jrf.
See #55652.
Built from https://develop.svn.wordpress.org/trunk@53495


git-svn-id: http://core.svn.wordpress.org/trunk@53084 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-13 16:44:10 +00:00
Sergey Biryukov 30a9e469b8 Tests: Rename classes in `phpunit/tests/option/` per the naming conventions.
https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#naming-and-organization

Follow-up to [47780], [48911], [49327], [50291], [50292], [50342], [50452], [50453], [50456], [50967], [50968], [50969], [51491], [51492], [51493], [51623], [51639], [51646], [51650], [51651], [51860], [52264], [52265], [53489].

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53494


git-svn-id: http://core.svn.wordpress.org/trunk@53083 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-13 15:26:10 +00:00
Sergey Biryukov ca2e67d1b0 Tests: Add a unit test for PHP 8.1 deprecation notice in `wp_user_settings()`.
This ensures that PHP 8.1 "passing null to non-nullable" deprecation notice is not thrown for the `$domain` parameter of `setcookie()` calls in the function.

Follow-up to [53490].

See #54914.
Built from https://develop.svn.wordpress.org/trunk@53493


git-svn-id: http://core.svn.wordpress.org/trunk@53082 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-13 15:22:10 +00:00
Sergey Biryukov e3e07d2751 Tests: Use more consistent wording when referring to PHP deprecation notices.
Follow-up to [51619], [51695].

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53492


git-svn-id: http://core.svn.wordpress.org/trunk@53081 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-13 14:53:11 +00:00
Sergey Biryukov c12b446f41 Tests: Use a consistent URL in HTTP response cookie tests.
Follow-up to [34369], [35734], [38164].

See #51568.
Built from https://develop.svn.wordpress.org/trunk@53491


git-svn-id: http://core.svn.wordpress.org/trunk@53080 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-12 15:18:10 +00:00
Sergey Biryukov 6151fddb6c Code Modernization: Pass correct default value to `setcookie()` in `wp_user_settings()`.
The `wp_user_settings()` function calls the PHP native `setcookie()` function, the fifth parameter of which is the ''optional'' `$domain` 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 `setcookie(): Passing null to parameter #5 ($domain) of type string is deprecated` notice.

Changing the `null` to an empty string fixes this without a backward compatibility break.

References:
* [https://www.php.net/manual/en/function.setcookie.php PHP Manual: setcookie()]
* [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 [29478].

Props ocean90, shenyanzhi, meysamnorouzi, jrf.
Fixes #54914.
Built from https://develop.svn.wordpress.org/trunk@53490


git-svn-id: http://core.svn.wordpress.org/trunk@53079 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-12 11:11:11 +00:00
Sergey Biryukov 97eff9b7b2 Tests: Rename classes in `phpunit/tests/user/` per the naming conventions.
https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#naming-and-organization

Follow-up to [47780], [48911], [49327], [50291], [50292], [50342], [50452], [50453], [50456], [50967], [50968], [50969], [51491], [51492], [51493], [51623], [51639], [51646], [51650], [51651], [51860], [52264], [52265].

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53489


git-svn-id: http://core.svn.wordpress.org/trunk@53078 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-11 15:50:08 +00:00
Sergey Biryukov df324b9ff6 Tests: Re-initialize `WP_Rewrite` before running `wp_list_authors()` tests.
This ensures that the expected results use the default permalink structure, not affected by other tests.

Follow-up to [27550], [27684], [53487].

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53488


git-svn-id: http://core.svn.wordpress.org/trunk@53077 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-11 15:36:13 +00:00
Sergey Biryukov 193a959806 Tests: Rename the test file and class for `wp_list_authors()` tests.
This matches the name of the function being tested.

Follow-up to [27550].

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53487


git-svn-id: http://core.svn.wordpress.org/trunk@53076 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-11 13:43:13 +00:00
audrasjb df0d910007 Query: Add a hook to filter author full name from `wp_list_authors()`.
This changeset introduces the `wp_list_author_full_name` hook to allows developers to filter author full name, which by default is a combinaison of the author first and last name, separated by a space.

Props kevinB, wonderboymusic, DrewAPicture, nacin, Mte90, jorbin, afercia, rafiahmedd.
Fixes #17025.

Built from https://develop.svn.wordpress.org/trunk@53486


git-svn-id: http://core.svn.wordpress.org/trunk@53075 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-10 18:23:18 +00:00
spacedmonkey c8f31dc0c0 REST API: Improve post cache priming in `WP_REST_Post_Search_Handler` class.
In the `WP_REST_Post_Search_Handler` class, ensure that post, post meta and term caches are correctly primed when performing a search.

Props furi3r, spacedmonkey, TimothyBlynJacobs, audrasjb, peterwilsoncc. 
Fixes #55674.


Built from https://develop.svn.wordpress.org/trunk@53485


git-svn-id: http://core.svn.wordpress.org/trunk@53074 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-10 15:47:08 +00:00
Sergey Biryukov a29c6663fd Docs: Use typed array notation in some post function DocBlocks:
* `wp_queue_posts_for_term_meta_lazyload()`
* `_prime_post_caches()`

See #55646.
Built from https://develop.svn.wordpress.org/trunk@53484


git-svn-id: http://core.svn.wordpress.org/trunk@53073 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-10 15:22:11 +00:00
Sergey Biryukov 9e01bd8adc Query: Some documentation and test improvements for `update_post_author_caches()`:
* Make the descriptions for `update_post_author_caches()` and `update_post_caches()` more specific.
* Move the unit test into its own file, for consistency with `update_post_cache()` tests. This also allows for using shared fixtures in case more tests are added in the future.

Follow-up to [53482].

See #55716.
Built from https://develop.svn.wordpress.org/trunk@53483


git-svn-id: http://core.svn.wordpress.org/trunk@53072 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-10 15:17:10 +00:00
spacedmonkey 2237f67458 Prime users cache in WP_Query and post REST API controller.
For a call to `WP_Query` or a post REST API request that contains posts from multiple authors, call the `cache_users` function, to ensure that all user data for post authors is primed in 
a single database query. This results in far fewer database queries on multiple author sites. 

Props spacedmonkey, timothyblynjacobs, peterwilsoncc.
Fixes #55716.

Built from https://develop.svn.wordpress.org/trunk@53482


git-svn-id: http://core.svn.wordpress.org/trunk@53071 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-10 13:39:11 +00:00
Sergey Biryukov 558cd4c353 Media: Some documentation and test improvements for `wp_img_tag_add_decoding_attr()`:
* Add a `@since` note for the `decoding` attribute in `wp_get_attachment_image()`.
* Adjust `wp_img_tag_add_decoding_attr()` DocBlocks per the documentation standards.
* Wrap some long `sprintf()` calls in unit tests for better readability. In at least one case, `the_content` was unnecessarily passed to `sprintf()` as an extra (unused) parameter.

Follow-up to [53480].

See #53232.
Built from https://develop.svn.wordpress.org/trunk@53481


git-svn-id: http://core.svn.wordpress.org/trunk@53070 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-09 16:21:14 +00:00
Peter Wilson b8e44627c8 Media: Add `decoding="async"` to image attributes.
Dynamically add `decoding="async"` to image tags on the front end of a site to instruct browsers to download them in parallel.

Modifies `wp_get_attachment_image()`, `get_avatar()` to include the attribute by default. Modifies `wp_filter_content_tags()` to add the attribute during the front-end render of the site.

Introduces `wp_img_tag_add_decoding_attr()` to take an image tag and modify it to include the attribute. Introduces the filter `wp_img_tag_add_decoding_attr` used to define the default value for the attribute.

Props adamsilverstein, ayeshrajans, costdev, flixos90, hellofromtonya, isaumya, michaelbourne, mihai2u, mitogh, sergiomdgomes, spacedmonkey, westonruter, peterwilsoncc.
Fixes #53232.

Built from https://develop.svn.wordpress.org/trunk@53480


git-svn-id: http://core.svn.wordpress.org/trunk@53069 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-09 05:31:12 +00:00
Sergey Biryukov cf5df71b88 Tests: Correct an assertion in `wp_rand()` tests.
The function returns non-negative integers, which includes zero.

Follow-up to [53473], [53477].

See #55194.
Built from https://develop.svn.wordpress.org/trunk@53479


git-svn-id: http://core.svn.wordpress.org/trunk@53068 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-08 13:19:14 +00:00
Sergey Biryukov 4b286c4f77 Tests: Move the tests for individual pluggable functions into their own directory.
This aims to make the tests more discoverable and easier to expand.

Follow-up to [50790], [53473], [53477].

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53478


git-svn-id: http://core.svn.wordpress.org/trunk@53067 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-07 14:45:12 +00:00
Sergey Biryukov e380ff685d Tests: Use more descriptive names for `wp_rand()` test methods.
This aims to clarify the intention of the tests.

Follow-up to [53473].

Props mlajo, costdev, acoulombe, azouamauriac, swissspidy, tobifjellner, peterwilsoncc, audrasjb, marekdedic, SergeyBiryukov.
See #55194.
Built from https://develop.svn.wordpress.org/trunk@53477


git-svn-id: http://core.svn.wordpress.org/trunk@53066 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-07 12:03:12 +00:00
audrasjb 7821fe08db Text Changes: Improve consistency of admin error notices in `wp-admin/options.php`.
This changeset replaces <strong>Error</strong>: with <strong>Error:</strong>, for better consistency.

Follow-up to [53458].

Fixes #50785.

Built from https://develop.svn.wordpress.org/trunk@53476


git-svn-id: http://core.svn.wordpress.org/trunk@53065 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-07 05:30:13 +00:00
audrasjb 2029a33158 Twenty-Twenty: Fix a width/alignement issue on "Wide Line" Separator style variation.
This change fixes an alignement issue on the "Wide Line" Separator style variation on front-end, especially when used inside a column block. It changes the block `width` value from `120rem` to `100%` to avoid container overflowing.

Props kjellr, matthiaspabst, sabernhardt, audrasjb.
Fixes #53643.

Built from https://develop.svn.wordpress.org/trunk@53475


git-svn-id: http://core.svn.wordpress.org/trunk@53064 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-07 05:23:09 +00:00
audrasjb 20c003e842 Docs: Use third-person singular verbs for function descriptions in the `Core Translation` API.
See #55646.

Built from https://develop.svn.wordpress.org/trunk@53474


git-svn-id: http://core.svn.wordpress.org/trunk@53063 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-07 05:18:13 +00:00
audrasjb 56d7437f59 General: Ensure `wp_rand()` returns `0` when `$min` and `$max` values are equal to `0`.
This changeset ensures `wp_rand()` returns zero instead of a random number when both `$min` and `$max` values are equal to zero.

Fixes #55194.

Built from https://develop.svn.wordpress.org/trunk@53473


git-svn-id: http://core.svn.wordpress.org/trunk@53062 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-06 22:50:10 +00:00
audrasjb 0ab9c4ee4b Docs: Various fixes in `wp-includes/pluggable.php` docblocks, as per documentation standards.
See #55646.

Built from https://develop.svn.wordpress.org/trunk@53472


git-svn-id: http://core.svn.wordpress.org/trunk@53061 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-06 22:35:10 +00:00
audrasjb 312f7d4b76 Twenty-Twenty: Fix paragraph block alignment issues when used on a RTL website.
Twenty Twenty's `style.css` file has `/*rtl:ignore*/` for the `.has-text-align-left` class, but that was previously missing from the `.has-text-align-right` class. As a result, the theme overrides block library styles on the front-end (and not in the editor). This changeset adds the missing declaration.

Props amirkamizi, mayankmajeji, ianbelanger, sabernhardt, hasanuzzamanshamim.
Fixes #49447.

Built from https://develop.svn.wordpress.org/trunk@53471


git-svn-id: http://core.svn.wordpress.org/trunk@53060 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-06 21:42:13 +00:00
audrasjb 5d96ddab10 Twenty-Twenty: Improve Quote block style consistency between front and back-end.
This changeset updates the `font-style` value of the Quote block in the block editor to ensure styles are consistent between the editor and the front-end.

Props kajalgohel, iamjaydip, audrasjb, whaze, mukesh27.
Fixes #55931.


Built from https://develop.svn.wordpress.org/trunk@53470


git-svn-id: http://core.svn.wordpress.org/trunk@53059 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-06 13:31:15 +00:00
Sergey Biryukov a29a0e05d1 Docs: Correct method reference format in some DocBlocks.
This ensures that the methods are recognized by the WordPress Code Reference parser.

Follow-up to [7994], [25567], [27156], [28887], [49672], [52226].

Props dd32, audrasjb.
Fixes #55928.
Built from https://develop.svn.wordpress.org/trunk@53469


git-svn-id: http://core.svn.wordpress.org/trunk@53058 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-06 10:51:12 +00:00
desrosj 1ce3b1ae3b Build/Test Tools: Correctly confirm the previous workflow run was triggered by a push event.
This fixes the code added in [53466] to look at the correct workflow object when determining the outcome of the previous workflow run.

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53468


git-svn-id: http://core.svn.wordpress.org/trunk@53057 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-05 19:45:15 +00:00
Sergey Biryukov 6c79e4b29b Tests: Update the URL to the documentation on GitHub Actions environment variables.
Follow-up to [49264].

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53467


git-svn-id: http://core.svn.wordpress.org/trunk@53056 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-05 14:06:11 +00:00
desrosj 6a7de2d74a Build/Test Tools: Prevent inaccurate “fixed” notifications in Slack.
When searching for previous workflow runs by branch, GitHub currently includes matches within forks.

If a contributor opens a pull request from their fork with a `head_ref` matching a Core branch that triggers a workflow on `push` event, the outcomes of the workflows associated with that pull request are currently used to determine if the previous workflow run had failed.

The result is a false “fixed” notifications when a commit immediately follows a failed workflow run from the pull request.

This adds a check to skip any workflow runs not triggered by a `push` event to prevent these inaccurate notifications.

Props SergeyBiryukov.
See #55652.
Built from https://develop.svn.wordpress.org/trunk@53466


git-svn-id: http://core.svn.wordpress.org/trunk@53055 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-05 09:31:13 +00:00
Sergey Biryukov 5a2b984cc0 Tests: Don't overwrite image metadata in a `wp_calculate_image_srcset()` test for zero width.
This was unnecessarily replacing the original image metadata with a scaled version, leading to a few leftover images with the `-scaled` suffix in the `wp-content/uploads` directory.

Follow-up to [35412].

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53465


git-svn-id: http://core.svn.wordpress.org/trunk@53054 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-04 18:05:08 +00:00
Sergey Biryukov 61b7a2a3e2 Tests: Consistently pass the `$force_delete` parameter to `wp_delete_attachment()`.
Convert some `wp_delete_post()` calls to `wp_delete_attachment()` to avoid an extra function call.

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53464


git-svn-id: http://core.svn.wordpress.org/trunk@53053 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-04 13:41:08 +00:00
Sergey Biryukov 854a06a4ad Tests: Clean up test images before performing assertions in image resize tests.
This makes sure there are no leftover images in case of a test failure.

Follow-up to [161/tests], [1255/tests].

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53463


git-svn-id: http://core.svn.wordpress.org/trunk@53052 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-04 12:57:10 +00:00
audrasjb 343af672af Docs: Replace "updated" with "deleted" in `wpdb::delete` @return description.
Props audrasjb, cadlec.
See #55646.

Built from https://develop.svn.wordpress.org/trunk@53462


git-svn-id: http://core.svn.wordpress.org/trunk@53051 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-04 12:15:12 +00:00
Sergey Biryukov 3fec80568e Tests: Add some test cases for `path_join()` with Windows paths.
Follow-up to [6984], [53457], [53460].

Props joyously.
See #55897.
Built from https://develop.svn.wordpress.org/trunk@53461


git-svn-id: http://core.svn.wordpress.org/trunk@53050 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-03 15:07:21 +00:00
Sergey Biryukov 1d2e969b50 General: Remove redundant `ltrim()` from `path_join()`.
If the path starts with a slash, it will be considered absolute and returned as is earlier in the function.

It it's not absolute, then it does not start with a slash, so there is nothing to trim.

This change is covered by existing unit tests.

Follow-up to [6984], [53457].

Props karlijnbk.
See #55897.
Built from https://develop.svn.wordpress.org/trunk@53460


git-svn-id: http://core.svn.wordpress.org/trunk@53049 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-02 15:31:08 +00:00
audrasjb e05a38f0a5 Twenty-Twenty: Alignment fix on Separator Block editor styles.
This changeset fixes an issue with some CSS rules of the "Wide Line" variation of the Separator Block’s editor stylesheet, for small, medium and large screens.

Props umesh84, iamjaydip, mukesh27, larrach.
Fixes #55896.

Built from https://develop.svn.wordpress.org/trunk@53459


git-svn-id: http://core.svn.wordpress.org/trunk@53048 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-02 15:10:10 +00:00
audrasjb bbe60d66c3 Text Changes: Improve consistency of admin error notices.
This changeset replaces `<strong>Error</strong>:` with `<strong>Error:</strong>`, for better consistency.

Props transl8or, mihaidumitrascu, audrasjb.
Fixes #50785.

Built from https://develop.svn.wordpress.org/trunk@53458


git-svn-id: http://core.svn.wordpress.org/trunk@53047 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-02 15:05:13 +00:00
Sergey Biryukov 6f2e2a33be Tests: Add unit tests for `path_join()`.
Props karlijnbk.
See #55897.
Built from https://develop.svn.wordpress.org/trunk@53457


git-svn-id: http://core.svn.wordpress.org/trunk@53046 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-02 15:00:13 +00:00
audrasjb a6539b8cfb Docs: Use third-person singular verbs for method descriptions in `wp-includes/post.php`, as per docs standards.
Props whaze.
See #55646.

Built from https://develop.svn.wordpress.org/trunk@53456


git-svn-id: http://core.svn.wordpress.org/trunk@53045 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-02 10:55:11 +00:00
Sergey Biryukov 01d172b581 General: Replace all `esc_url_raw()` calls in core with `sanitize_url()`.
This aims to improve performance by calling `sanitize_url()` directly, instead of the `esc_url_raw()` wrapper. As of WordPress 6.1, `sanitize_url()` is the recommended function for sanitizing a URL for database or redirect usage.

Follow-up to [11383], [13096], [51597], [53452].

Props benjgrolleau, peterwilsoncc, SergeyBiryukov.
Fixes #55852.
Built from https://develop.svn.wordpress.org/trunk@53455


git-svn-id: http://core.svn.wordpress.org/trunk@53044 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-01 18:14:10 +00:00
Sergey Biryukov 3be126b751 Tests: Require the `zip` PHP extension in block templates export file test.
This avoids a test failure if the `ZipArchive` class is missing.

Additionally, this commit replaces an inline check for the `ZipArchive` class in personal data export file tests with a `@requires` annotation, for consistency with similar PHP extension requirements in other tests.

Follow-up to [44786], [51415], [52286].

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53454


git-svn-id: http://core.svn.wordpress.org/trunk@53043 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-01 14:18:10 +00:00
Sergey Biryukov f2a7f4a387 I18N: Use consistent context for the "Add New" string when referring to media.
This replaces the only instance of the `add new media` context with `file`, used in other instances of the string.

Follow-up to [9198], [10680], [21948].

Props benjgrolleau, tobifjellner, SergeyBiryukov.
Fixes #55876.
Built from https://develop.svn.wordpress.org/trunk@53453


git-svn-id: http://core.svn.wordpress.org/trunk@53042 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-31 18:39:10 +00:00
Sergey Biryukov d0712f35d4 Formatting: Make `sanitize_url()` the recommended function for sanitizing a URL.
A general security rule is "Sanitize when you save, escape when you echo".

In WordPress 5.9, `sanitize_url()` was un-deprecated in order to better align with the naming of other sanitizing functions, while still being an alias for `esc_url_raw()`.

This commit reverses the order and turns `esc_url_raw()` into a wrapper for `sanitize_url()`, making the latter the canonical function call and aiming to improve performance by reducing the number of function calls required when using the recommended technique.

Follow-up to [11383], [13096], [51597].

Props benjgrolleau, peterwilsoncc, SergeyBiryukov.
See #55852.
Built from https://develop.svn.wordpress.org/trunk@53452


git-svn-id: http://core.svn.wordpress.org/trunk@53041 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-31 15:17:14 +00:00
Sergey Biryukov 9268ef9788 Media: Add support for WebP images in the Thickbox library.
This ensures that `.webp` images are properly recognized and displayed in the modal as expected.

Follow-up to [50810], [51227], [52073].

Props ilunabar, graham73may, sabernhardt, mukesh27, SergeyBiryukov.
Fixes #55786.
Built from https://develop.svn.wordpress.org/trunk@53451


git-svn-id: http://core.svn.wordpress.org/trunk@53040 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-30 14:53:11 +00:00
Sergey Biryukov d842b3b5c3 Docs: Explicitly declare some globals for clarity.
This aims to improve developer experience by making it clear that these variables are defined elsewhere.

Props ravipatel, davidbaumwald, hellofromTonya, costdev, SergeyBiryukov.
Fixes #51439.
Built from https://develop.svn.wordpress.org/trunk@53450


git-svn-id: http://core.svn.wordpress.org/trunk@53039 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-29 15:35:11 +00:00
Sergey Biryukov 9a2a423eb6 Quick/Bulk Edit: Check the `show_in_quick_edit` taxonomy property when processing the data for bulk edited posts.
Previously, setting the `show_in_quick_edit` property to `false` removed the taxonomy from the inline edit form, but several taxonomy-related database queries were still being performed in `bulk_edit_posts()` when building the arguments to pass to `wp_update_post()`, even though terms were not modified.

This commit improves performance by avoiding unnecessary database queries when `show_in_quick_edit` is `false`, and mirrors a similar check in the `get_inline_data()` function.

Follow-up to [13535], [14580], [31307], [52841], [53368].

Props Chouby, sabernhardt, costdev, nalininonstopnewsuk, webcommsat, marybaum, meher, wparslan, SergeyBiryukov.
Fixes #42474.
Built from https://develop.svn.wordpress.org/trunk@53449


git-svn-id: http://core.svn.wordpress.org/trunk@53038 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-27 15:51:12 +00:00
Peter Wilson 290742cada Budled themes: Revert the Twenty Ten theme version to 3.6.
No functional changes were made to Twenty Ten during the WordPress 6.0 release cycle so the theme version bump is not needed. The "tested up to" header change is maintained.

Follow up to and partial revert of [53418].

Props desrosj, ravipatel, costdev.
Fixes #55810.
See #55754.


Built from https://develop.svn.wordpress.org/trunk@53448


git-svn-id: http://core.svn.wordpress.org/trunk@53037 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-25 02:51:09 +00:00
Peter Wilson cf5cf75f09 Help/About: Add cache busting string to video thumbnail.
Append `?ver=6.0` to the image used for linking to the video to break the cache in browsers, proxy servers and on the CDN.

A new version of the image has been uploaded and replaced the file in the original location.

Props annezazu, critterverse, ryelle, costdev, ironprogrammer, dd32.
Fixes #55808.


Built from https://develop.svn.wordpress.org/trunk@53447


git-svn-id: http://core.svn.wordpress.org/trunk@53036 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-25 02:19:17 +00:00
Peter Wilson 5214e469df Help/About: Finalise links on about page.
Wrap up about page for 6.0 release.

Props ryelle, mukesh27, hellofromTonya, SergeyBiryukov, peterwilsoncc.
Fixes #55775.


Built from https://develop.svn.wordpress.org/trunk@53442


git-svn-id: http://core.svn.wordpress.org/trunk@53031 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-23 23:53:13 +00:00
Sergey Biryukov d0e055e68f Coding Standards: Correct alignment in various files.
This fixes an `Equals sign not aligned correctly` WPCS warning.

Additionally, this commit sets the `svn:eol-style` property for the `phpunit/tests/ajax/wpAjaxCropImage.php` file and corrects line endings, so that the output of `composer format` is clean.

Follow-up to [53027], [53217], [53404].

Props hellofromTonya, SergeyBiryukov.
See #55647.
Built from https://develop.svn.wordpress.org/trunk@53441


git-svn-id: http://core.svn.wordpress.org/trunk@53030 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-23 20:40:14 +00:00
Sergey Biryukov 653a3af0d4 Upgrade/Install: Update `$_old_files` for 6.0.
Props hellofromTonya, JeffPaul, SergeyBiryukov.
Fixes #55794.
Built from https://develop.svn.wordpress.org/trunk@53439


git-svn-id: http://core.svn.wordpress.org/trunk@53028 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-23 17:02:16 +00:00
ryelle c07f05ab86 Administration: Fix image overlap in Dashboard welcome panel.
Use longhand positioning properties (top, right, etc) so that the rtlcss build process can correctly adjust the layout for the RTL CSS.

Props ryelle, costdev, ironprogrammer, hellofromtonya.
Fixes #55793.


Built from https://develop.svn.wordpress.org/trunk@53437


git-svn-id: http://core.svn.wordpress.org/trunk@53026 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-23 16:48:15 +00:00
Sergey Biryukov 6e15f7fc9a Docs: Use third-person singular verbs for method descriptions in `wp-includes/class-wp-roles.php`, per the documentation standards.
See #55646.
Built from https://develop.svn.wordpress.org/trunk@53436


git-svn-id: http://core.svn.wordpress.org/trunk@53025 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-23 15:01:12 +00:00
Sergey Biryukov b2869c1e62 General: Bump the recommended MariaDB version in `readme.html`.
MariaDB 10.2 has reached EOL in May 2022. The recommended minimum is bumped to 10.3 for now.

Follow-up to [52319], [52358], [52420], [52424], [53431], [53433], [meta11866].

Props hellofromTonya.
Fixes #55791. See #meta6322.
Built from https://develop.svn.wordpress.org/trunk@53435


git-svn-id: http://core.svn.wordpress.org/trunk@53024 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-23 14:22:10 +00:00
Sergey Biryukov 538587ef1d Tests: Improve the assertions in recommended MySQL and MariaDB version tests.
Comparing human-readable dates instead of numeric timestamps gives identical results, but makes the message more clear in case of failure.

Follow-up to [33946], [52418], [52421], [52424].

See #55791, #55652.
Built from https://develop.svn.wordpress.org/trunk@53433


git-svn-id: http://core.svn.wordpress.org/trunk@53022 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-23 14:09:12 +00:00
hellofromTonya 59d78a1dd4 Build/Test Tools: Temporarily skip MariaDB version test.
TEMPORARY COMMIT.

MariaDB version 10.2 is no longer supported as of 23 May 2022. This commit temporarily skips the version test. Why? To avoid test failures during this period, i.e. until the version is bummped and `readme.html` file changed.

See #55791, [https://meta.trac.wordpress.org/ticket/5999 Meta5999].
Built from https://develop.svn.wordpress.org/trunk@53431


git-svn-id: http://core.svn.wordpress.org/trunk@53020 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-23 13:32:07 +00:00
hellofromTonya fd34524107 Build/Test Tools: Fix comments odd/even instabilities (test leaks).
The odd / even class attribute global variables are causing issues in comments tests when a new test is added or an existing test is modified. To stabilize the odd / even comment tests, the comment global variables are added to the base test class' `tear_down()` using the same patterns as the other global resets. This change ensures each comment test starts at the same state. In doing so, the expected odd / even class attributes are no longer affected by previous tests, i.e. test leaks.

Follow-up to [53172].

Props hellofromTonya, zieladam, peterwilsoncc.
See #54725.
Built from https://develop.svn.wordpress.org/trunk@53430


git-svn-id: http://core.svn.wordpress.org/trunk@53019 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-23 11:56:13 +00:00
Sergey Biryukov f6412575c8 Query: Check if `$wp_query` is set in query loop functions.
This avoids a PHP fatal error if any of these functions are called too early:

* `have_posts()`
* `in_the_loop()`
* `rewind_posts()`
* `the_post()`
* `have_comments()`
* `the_comment()`

bringing some consistency with conditional tags: `is_single()`, `is_home()`, etc.

This commit also removes unnecessary `return` from `the_comment()`, for consistency with `the_post()`. As `WP_Query::the_comment()` does not have a return value, this statement did not have any effect in practice.

Follow-up to [4934], [8807], [16947], [17068], [17083], [49147], [53395], [53396], [53400].

Props vdankbaar, thijso, teunvgisteren, timkersten655, SergeyBiryukov.
Fixes #55722.
Built from https://develop.svn.wordpress.org/trunk@53429


git-svn-id: http://core.svn.wordpress.org/trunk@53018 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-22 15:17:14 +00:00
Sergey Biryukov f4af743ea7 Docs: Correct the type for `WP_Post::$post_category` and `::$tags_input`.
These properties are arrays of category IDs and tag names, respectively, not a single integer or string.

Follow-up to [21651], [31127], [32729], [48941].

Props omaeyusuke.
Fixes #55785.
Built from https://develop.svn.wordpress.org/trunk@53428


git-svn-id: http://core.svn.wordpress.org/trunk@53017 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-21 12:07:13 +00:00
desrosj 766a38f2fb Build/Test Tools: Link to a specific run attempt in GitHub Action Slack notifications.
This adjusts the workflow run URLs included in Slack notifications to link to the specific attempt being reported on making it easier for someone to see the proper context of a specific notification.

Additionally, this eliminates the need for a contributor to share the reason for a failure in Slack before restarting the workflow, as the link will always be to that specificattempt. When a “fixed” notification occurs for a subsequent run attempt, the link will be to the new, successful run attempt.

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53427


git-svn-id: http://core.svn.wordpress.org/trunk@53016 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-20 17:42:09 +00:00
Sergey Biryukov 40fc19024f Code Modernization: Replace `phpversion()` function calls with `PHP_VERSION` constant.
`phpversion()` return value and `PHP_VERSION` constant value are identical, but the latter is several times faster because it is a direct constant value lookup compared to a function call.

Props ayeshrajans, jrf, mukesh27, costdev, hellofromTonya, SergeyBiryukov.
Fixes #55680.
Built from https://develop.svn.wordpress.org/trunk@53426


git-svn-id: http://core.svn.wordpress.org/trunk@53015 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-20 17:38:14 +00:00
gziolo 59c970101f Docs: Add missing documentation for fallback_gap_value param
Follow-up for [53420]. 

Props SergeyBiryukov.
See #55567.


Built from https://develop.svn.wordpress.org/trunk@53421


git-svn-id: http://core.svn.wordpress.org/trunk@53010 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-20 15:35:14 +00:00
gziolo cbcf19d09d Editor: Update WordPress packages for 6.0 RC 4
Included cherry-picked commits from the Gutenberg plugin that fix bugs discovered after WordPress 6.0 RC 3.

Props zieladam.
See #55567.



Built from https://develop.svn.wordpress.org/trunk@53420


git-svn-id: http://core.svn.wordpress.org/trunk@53009 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-20 14:32:40 +00:00
gziolo b020766e3d Editor: Fix opinionated block styles loading in editor
Related changes in Gutenberg: https://github.com/WordPress/gutenberg/pull/40937.

Backport for WordPress 6.0 RC 4.

Props jffng.
See #55567.


Built from https://develop.svn.wordpress.org/trunk@53419


git-svn-id: http://core.svn.wordpress.org/trunk@53008 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-20 11:42:19 +00:00
Peter Wilson 55a5dbcf27 Bundled themes: Bump versions for WordPress 6.0 release.
Bump bundled theme version numbers in preparation for the WordPress 6.0 release. Each theme's _tested up to_ file header has been increased to indicate WordPress 6.0 support.

The new version numbers are:

* Twenty Ten: 3.7
* Twenty Eleven: 4.1
* Twenty Twelve: 3.7
* Twenty Thirteen*: 3.7
* Twenty Fourteen: 3.4
* Twenty Fifteen*: 3.2
* Twenty Sixteen*: 2.7
* Twenty Seventeen*: 3.0
* Twenty Nineteen: 2.3
* Twenty Twenty: 2.0
* Twenty Twenty-One: 1.6

An asterisk indicates the theme includes assets requiring a manual version bump, this is set to the reverse date format of the release day: `20220524`.

Follow up to [53286] in which the Twenty Twenty-Two theme version was bumped to 1.2.

Props peterwilsoncc, desrosj, costdev, mehedi890.
Fixes #55754.


Built from https://develop.svn.wordpress.org/trunk@53418


git-svn-id: http://core.svn.wordpress.org/trunk@53007 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-20 01:49:16 +00:00
Peter Wilson ec3b0158d8 Themes: Accept valid block themes.
Updates theme validation to accept block themes. This replaces the requirement for an `index.php` with a requirement for either an `index.php`, `/templates/index.html` or the deprecated `/block-templates/index.html`.

Validation is updated for theme uploads, within `WP_Theme::__construct` and `validate_current_theme()`. 

A block theme using the deprecated file structure is now included in the unit tests.

Props peterwilsoncc, sergeybiryukov, hellofromtonya, costdev, azaozz, gziolo, FlorianBrinkmann, Boniu91, aristath, poena, audrasjb.
Fixes #55754.

Built from https://develop.svn.wordpress.org/trunk@53416


git-svn-id: http://core.svn.wordpress.org/trunk@53005 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-20 00:49:18 +00:00
Sergey Biryukov 4b46629139 Accessibility: List Tables: Hide the Comments column icon and `title` attribute from screen readers.
The element already has non-visual text, making the icon and the `title` attribute redundant for assistive technologies.

Follow-up to [22439], [27548], [31513], [32991], [50804].

Props sabernhardt, ryokuhi, afercia, karlgroves, SergeyBiryukov.
Fixes #55555. See #24766.
Built from https://develop.svn.wordpress.org/trunk@53414


git-svn-id: http://core.svn.wordpress.org/trunk@53003 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-19 15:54:15 +00:00
Peter Wilson 08c5dbc7e9 Site Editor: Include `style` parameter in home template redirect.
When redirecting the site editor to the home template include the `style` querystring parameter if it is set. This ensures the style panel opens if the user expects it.

Props grantmkin, mamaduka, peterwilsoncc.
Fixes #55752.


Built from https://develop.svn.wordpress.org/trunk@53413


git-svn-id: http://core.svn.wordpress.org/trunk@53002 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-19 02:27:13 +00:00
Sergey Biryukov 6d0b0d9a4b Docs: Add missing documentation for some Customize class properties:
* `WP_Customize_Background_Image_Control::$type`
* `WP_Customize_Background_Image_Setting::$id`
* `WP_Customize_Header_Image_Setting::$id`

Follow-up to [21037], [21053], [30885].

Props iamjaydip.
See #55646.
Built from https://develop.svn.wordpress.org/trunk@53411


git-svn-id: http://core.svn.wordpress.org/trunk@53000 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-18 15:24:14 +00:00
audrasjb d4f6347b94 Twenty Twenty-Two: Fix typo in Dark Footer pattern docblock.
Props passoniate, audrasjb.
Fixes #55772.

Built from https://develop.svn.wordpress.org/trunk@53410


git-svn-id: http://core.svn.wordpress.org/trunk@52999 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-18 12:57:12 +00:00
Peter Wilson 88f38062e2 Help/About: Ensure about page shows current header.
Add a query string parameter to the about page header images to ensure the cache is broken in browsers and CDNs.

Props ryelle.
Fixes #55750.


Built from https://develop.svn.wordpress.org/trunk@53409


git-svn-id: http://core.svn.wordpress.org/trunk@52998 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-18 03:01:13 +00:00
Sergey Biryukov 2972db4ba5 Users: Fail gracefully when checking mapped capabilities without providing the required object ID.
This avoids an `Undefined array key 0` PHP warning for `current_user_can()` capability checks that require a specific object to check against but an object ID was not passed.

A `_doing_it_wrong()` notice is also added, so that developers and site administrators are aware that the capability mapping is failing in the absence of the required object ID.

The list of mapped capabilities that require an object ID:

* `delete_post` / `delete_page`
* `edit_post` / `edit_page`
* `read_post` / `read_page`
* `publish_post`
* `edit_(post|comment|term|user)_meta` / `delete_*_meta` / `add_*_meta`
* `edit_comment`
* `edit_term` / `delete_term` / `assign_term`

Follow-up to [34091], [34113], [47178].

Props jeherve, peterwilsoncc, henry.wright, johnbillion, mattheweppelsheimer, hellofromTonya, JeffPaul, azouamauriac, Ninos Ego, TobiasBg, wpsmith, GaryJ, nacin, johnstonphilip, azaozz, SergeyBiryukov.
Fixes #44591.
Built from https://develop.svn.wordpress.org/trunk@53408


git-svn-id: http://core.svn.wordpress.org/trunk@52997 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-17 19:01:20 +00:00
gziolo 571e1e01b3 Editor: Return additional block patterns to server-generated settings
Reverts changes from [53155] to ensure backward compatibility.

Companion to Gutenberg changes https://github.com/WordPress/gutenberg/pull/40818. That makes sure that patterns registered with `admin_init` or `current_screen` hooks are not lost.

Props jsnajdr, zieladam, peterwilsoncc, johnstonphilip.
See #55567.


Built from https://develop.svn.wordpress.org/trunk@53404


git-svn-id: http://core.svn.wordpress.org/trunk@52993 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-17 14:38:14 +00:00
gziolo 58dfeaa86f Editor: Update WordPress packages for 6.0 RC 3
Included cherry-picked commits from the Gutenberg plugin that fix bugs discovered after WordPress 6.0 RC 2.

Props zieladam, ndiego.
See #55567.



Built from https://develop.svn.wordpress.org/trunk@53403


git-svn-id: http://core.svn.wordpress.org/trunk@52992 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-17 13:30:31 +00:00
gziolo 102004b505 Theme: Use a better method to determine the theme name during export
See the same change in the Gutenberg plugin: https://github.com/WordPress/gutenberg/pull/40829.

Props scruffian, davidbaumwald, jeremyfelt.
See #55567.



Built from https://develop.svn.wordpress.org/trunk@53402


git-svn-id: http://core.svn.wordpress.org/trunk@52991 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-17 12:10:14 +00:00
audrasjb c03decd0cb Users: Fix misalignment of new user password toggle button on mobile.
This fixes an issue where the password hide/show button was misaligned when creating a new user on small screens.

Props kebbet.
Fixes #55558.

Built from https://develop.svn.wordpress.org/trunk@53401


git-svn-id: http://core.svn.wordpress.org/trunk@52990 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-16 22:37:12 +00:00
Sergey Biryukov aeb3b7530a Tests: Use a data provider in the test for conditional tags returning early if `$wp_query` is not set.
Follow-up to [53395], [53396].

Props peterwilsoncc.
See #55104.
Built from https://develop.svn.wordpress.org/trunk@53400


git-svn-id: http://core.svn.wordpress.org/trunk@52989 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-16 14:11:12 +00:00
audrasjb e3def96108 Twenty Twenty-One: Add a missing HTML comment to indicate the end of `.post-thumbnail` section.
Props haritpanchal.
Fixes #55724.

Built from https://develop.svn.wordpress.org/trunk@53399


git-svn-id: http://core.svn.wordpress.org/trunk@52988 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-15 22:34:08 +00:00
audrasjb c29c6885c0 Coding Standards: Fix params indentation in `pre_get_network_by_path` hook docblock.
See #55647.

Built from https://develop.svn.wordpress.org/trunk@53398


git-svn-id: http://core.svn.wordpress.org/trunk@52987 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-15 20:32:08 +00:00
audrasjb 200283a99e Docs: Use third-person singular verbs for function descriptions in the `WP_Network` class.
See #55646.

Built from https://develop.svn.wordpress.org/trunk@53397


git-svn-id: http://core.svn.wordpress.org/trunk@52986 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-15 20:28:07 +00:00
Sergey Biryukov 313f6f8fe0 Tests: Expand the test for conditional tags returning early if `$wp_query` is not set.
When called too early, conditional query tags should throw a `_doing_it_wrong()` notice and return `false`. This commit verifies that behavior not only for `is_main_query()`, but for all the other conditional tags too.

Follow-up to [16947], [17068], [17083], [18699], [37985], [53395].

See #55104.
Built from https://develop.svn.wordpress.org/trunk@53396


git-svn-id: http://core.svn.wordpress.org/trunk@52985 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-15 15:57:13 +00:00
Sergey Biryukov a5db52030f Query: Check if `$wp_query` is set in `is_main_query()`.
This avoids a PHP fatal error and triggers a `_doing_it_wrong()` notice if `is_main_query()` is called too early, bringing consistency with all the other `is_*()` conditionals: `is_single()`, `is_home()`, etc.

Follow-up to [16947], [17068], [17083], [18699], [37985].

Props vdankbaar, nhadsall, johnbillion, costdev, thijsoo, teunvgisteren, timkersten655, SergeyBiryukov.
Fixes #55104.
Built from https://develop.svn.wordpress.org/trunk@53395


git-svn-id: http://core.svn.wordpress.org/trunk@52984 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-14 15:10:14 +00:00
Sergey Biryukov 04f9d9bdf6 Database: Use generic references to a database server in `ms_not_installed()`.
This replaces the references to “MySQL” with “your host’s database server” on the “Error establishing a database connection” page when Multisite could not be loaded. The generic “database server” term can refer to MySQL or MariaDB. Additionally, this brings some consistency with a similar error message in `wpdb::db_connect()`.

Follow-up to [52367], [52423].

Props tj692, hansjovisyoast, tobifjellner.
Fixes #55701.
Built from https://develop.svn.wordpress.org/trunk@53394


git-svn-id: http://core.svn.wordpress.org/trunk@52983 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-13 12:21:13 +00:00
Sergey Biryukov 2130878354 Docs: Replace Codex URL with a corresponding HelpHub article in the Additional CSS section in Customizer.
Follow-up to [45674-45677], [46740], [49912].

Props stevenlinx, audrasjb.
Fixes #55710. See #48987.
Built from https://develop.svn.wordpress.org/trunk@53393


git-svn-id: http://core.svn.wordpress.org/trunk@52982 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-12 17:57:17 +00:00
audrasjb 96c26acafd Taxonomy: Set `use_desc_for_title` to false by default in `wp_list_categories()`
This change removes the default `title` attribute of category links returned by `wp_list_categories()`, for better accessibility.

Props just0nequestion, joyously, andrija, audrasjb, sabernhardt.
Fixes #55530.
See #24766.

Built from https://develop.svn.wordpress.org/trunk@53392


git-svn-id: http://core.svn.wordpress.org/trunk@52981 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-12 14:06:21 +00:00
Sergey Biryukov f4d9778c98 Menus: Replace "drop down" (noun) with "dropdown" in a few strings.
This makes the spelling more consistent with other instances of the word in core.

Follow-up to [23844], [27676].

Props NekoJonez, mukesh27, SergeyBiryukov.
Fixes #55661.
Built from https://develop.svn.wordpress.org/trunk@53391


git-svn-id: http://core.svn.wordpress.org/trunk@52980 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-11 13:22:15 +00:00
audrasjb 3a48bc354d Twenty Twenty-One: i18n fix for privacy policy section title.
This change makes the Twenty Twenty-One privacy policy section title translatable.

Props nlpro.
Fixes #55709.

Built from https://develop.svn.wordpress.org/trunk@53390


git-svn-id: http://core.svn.wordpress.org/trunk@52979 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-11 08:46:17 +00:00
hellofromTonya 88a16c0ad7 Editor: Use stricter assertions in comment template tests.
Backport of the remaining Comment Template block tests from Gutenberg:

* `assertEquals()` replaced with `assertSameSetsWithIndex()`.
* assertion's argument order changed to ensure expected and then actual.

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

Props bernhard-reiter.
Fixes #55708.
Built from https://develop.svn.wordpress.org/trunk@53388


git-svn-id: http://core.svn.wordpress.org/trunk@52977 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-10 21:30:11 +00:00
ryelle e8c02840a7 Administration: Update design of the Dashboard welcome panel.
This updates the panel to match the 6.0 About page styles, with the 6.0 graphic changing color based on the selected admin color scheme.

Props fcoveram, critterverse, joedolson, SergeyBiryukov.
Fixes #55532.


Built from https://develop.svn.wordpress.org/trunk@53383


git-svn-id: http://core.svn.wordpress.org/trunk@52972 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-10 16:45:08 +00:00
ryelle 8817bba1bf Help/About: Update the About section for 6.0.
Switch the images to use the s.w.org CDN. Update the font style and spacing on the About page. Update the header images for Credits, Freedoms, and Privacy.

Props fcoveram, peterwilsoncc, SergeyBiryukov.
Fixes #55434.


Built from https://develop.svn.wordpress.org/trunk@53382


git-svn-id: http://core.svn.wordpress.org/trunk@52971 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-10 16:33:08 +00:00
gziolo 8f952495a7 Editor: Update WordPress packages for 6.0 RC 2 (part 2)
Includes cherry-picked commit from the Gutenberg plugin that fix a bug discovere just before WordPress 6.0 RC 2.

Props hellofromtonya, zieladam, kebbet.
See #55567.


Built from https://develop.svn.wordpress.org/trunk@53378


git-svn-id: http://core.svn.wordpress.org/trunk@52967 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-10 15:57:28 +00:00
gziolo 6a989e83f6 Editor: Update WordPress packages for 6.0 RC 2
Included cherry-picked commits from the Gutenberg plugin that fix bugs discovere after WordPress 6.0 RC 1.

Props zieladam, ndiego, hellofromtonya.
See #55567.



Built from https://develop.svn.wordpress.org/trunk@53377


git-svn-id: http://core.svn.wordpress.org/trunk@52966 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-10 14:49:35 +00:00
Sergey Biryukov cb2d81f6df Coding Standards: Restore the `$pieces` variable for SQL clauses in query classes.
This is a defensive coding measure that aims to reduce confusion. With this change, `$pieces` is explicitly used for the names, and `$clauses` for the values of the clauses.

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

Props peterwilsoncc.
See #55699.
Built from https://develop.svn.wordpress.org/trunk@53376


git-svn-id: http://core.svn.wordpress.org/trunk@52965 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-10 11:21:09 +00:00
Sergey Biryukov 4959a268c3 Coding Standards: Restore the `$pieces` variable in `WP_Query::get_posts()`.
This is a defensive coding measure that aims to reduce confusion. With this change, `$pieces` is explicitly used for the names, and `$clauses` for the values of the clauses.

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

Props peterwilsoncc.
See #55699.
Built from https://develop.svn.wordpress.org/trunk@53375


git-svn-id: http://core.svn.wordpress.org/trunk@52964 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-10 11:17:14 +00:00
Peter Wilson 1dff8e7973 Users: Improve `WP_User_Query` tests following [53362].
Props SergeyBiryukov.
See #53177.


Built from https://develop.svn.wordpress.org/trunk@53373


git-svn-id: http://core.svn.wordpress.org/trunk@52962 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-10 05:49:11 +00:00
Peter Wilson 8545c4493b Media: Remove error suppression in `wp_filesize()`.
Replace error suppressing in `wp_filesize()` with a `file_exists()` check before calling the native PHP `filesize()` function.

Follow up to [52837].

Props Cybr, johnbillion, spacedmonkey, antpb, azouamauriac, ironprogrammer, mukesh27, costdev, audrasjb, dlh.
Fixes #55678.
See #49412.

Built from https://develop.svn.wordpress.org/trunk@53372


git-svn-id: http://core.svn.wordpress.org/trunk@52961 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-10 05:02:11 +00:00
Sergey Biryukov 6aa2e2c123 Tests: Move `get_inline_data()` tests to a more appropriate place.
Since this is an admin template function and the tests check for specific output with certain taxonomy parameters, placing the tests along with other tests for the functions in the same file should make them easier to find and extend than when placed between general taxonomy registration tests.

Follow-up to [52841], [53368].

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53371


git-svn-id: http://core.svn.wordpress.org/trunk@52960 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-09 17:58:13 +00:00
Sergey Biryukov ad517e9c12 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.
Built from https://develop.svn.wordpress.org/trunk@53370


git-svn-id: http://core.svn.wordpress.org/trunk@52959 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-09 13:51:15 +00:00
Peter Wilson a5e2970995 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.


Built from https://develop.svn.wordpress.org/trunk@53368


git-svn-id: http://core.svn.wordpress.org/trunk@52957 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-09 00:34:11 +00:00
Peter Wilson 70e7eec175 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.


Built from https://develop.svn.wordpress.org/trunk@53366


git-svn-id: http://core.svn.wordpress.org/trunk@52955 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-08 23:59:11 +00:00
Sergey Biryukov 32c0cfe3b3 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.
Built from https://develop.svn.wordpress.org/trunk@53365


git-svn-id: http://core.svn.wordpress.org/trunk@52954 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-08 00:29:14 +00:00
Sergey Biryukov 8c8b0a203a 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.
Built from https://develop.svn.wordpress.org/trunk@53364


git-svn-id: http://core.svn.wordpress.org/trunk@52953 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-07 17:16:13 +00:00
Sergey Biryukov 8f805f4ddd Coding Standards: Remove extra space in `wp-admin/admin-ajax.php`.
Props rajeshraval786, costdev.
Fixes #55692.
Built from https://develop.svn.wordpress.org/trunk@53363


git-svn-id: http://core.svn.wordpress.org/trunk@52952 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-07 16:21:18 +00:00
Peter Wilson f6ef37b050 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.


Built from https://develop.svn.wordpress.org/trunk@53362


git-svn-id: http://core.svn.wordpress.org/trunk@52951 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-07 03:32:11 +00:00
Peter Wilson b27a924101 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.

Built from https://develop.svn.wordpress.org/trunk@53360


git-svn-id: http://core.svn.wordpress.org/trunk@52949 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-07 02:53:11 +00:00
John Blackbourn 9afce5d0af 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

Built from https://develop.svn.wordpress.org/trunk@53358


git-svn-id: http://core.svn.wordpress.org/trunk@52947 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-06 17:16:11 +00:00
Sergey Biryukov b230f10cf5 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.
Built from https://develop.svn.wordpress.org/trunk@53357


git-svn-id: http://core.svn.wordpress.org/trunk@52946 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-06 11:11:15 +00:00
Sergey Biryukov 7997df84a8 Site Health: Remove unused variables in `WP_Site_Health::get_test_plugin_version()`.
Follow-up to [44986].

Props david.binda, mukesh27.
Fixes #55683.
Built from https://develop.svn.wordpress.org/trunk@53355


git-svn-id: http://core.svn.wordpress.org/trunk@52944 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-05 16:29:08 +00:00
ryelle 686a22802b Help/About: Add link to 6.0 Field Guide, fix missing placeholder in string.
Props audrasjb.
Follow-up to [53339].
See #55434.


Built from https://develop.svn.wordpress.org/trunk@53354


git-svn-id: http://core.svn.wordpress.org/trunk@52943 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-05 15:35:10 +00:00
hellofromTonya 7acc6d1682 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.
Built from https://develop.svn.wordpress.org/trunk@53353


git-svn-id: http://core.svn.wordpress.org/trunk@52942 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-05 15:29:16 +00:00
Peter Wilson a34abb93b7 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.


Built from https://develop.svn.wordpress.org/trunk@53352


git-svn-id: http://core.svn.wordpress.org/trunk@52941 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-05 03:26:16 +00:00
Sergey Biryukov 18c2eaa8c0 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.
Built from https://develop.svn.wordpress.org/trunk@53349


git-svn-id: http://core.svn.wordpress.org/trunk@52938 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-04 00:40:11 +00:00
hellofromTonya 0ea8ac36ba 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.
Built from https://develop.svn.wordpress.org/trunk@53347


git-svn-id: http://core.svn.wordpress.org/trunk@52936 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-03 18:57:08 +00:00
Sergey Biryukov 68bcc2cbef 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.
Built from https://develop.svn.wordpress.org/trunk@53346


git-svn-id: http://core.svn.wordpress.org/trunk@52935 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-03 18:16:08 +00:00
Sergey Biryukov 9cf0633789 Build/Test Tools: Add the 6.0 branch to the workflow for testing branches.
Built from https://develop.svn.wordpress.org/trunk@53345


git-svn-id: http://core.svn.wordpress.org/trunk@52934 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-03 17:44:08 +00:00
Sergey Biryukov c583043223 Trunk is now 6.1-alpha.
Built from https://develop.svn.wordpress.org/trunk@53344


git-svn-id: http://core.svn.wordpress.org/trunk@52933 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-03 17:40:10 +00:00
Sergey Biryukov 61f74edbb3 Security: Update the Security Policy to include WordPress 6.0.
Built from https://develop.svn.wordpress.org/trunk@53342


git-svn-id: http://core.svn.wordpress.org/trunk@52931 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-03 17:34:09 +00:00
Sergey Biryukov 9efd001e48 Post WordPress 6.0 RC1 version bump.
Built from https://develop.svn.wordpress.org/trunk@53341


git-svn-id: http://core.svn.wordpress.org/trunk@52930 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-03 17:15:10 +00:00
Sergey Biryukov 638a31b8d3 WordPress 6.0 RC1
Built from https://develop.svn.wordpress.org/trunk@53340


git-svn-id: http://core.svn.wordpress.org/trunk@52929 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-03 16:46:09 +00:00
ryelle 7bd9548322 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.


Built from https://develop.svn.wordpress.org/trunk@53339


git-svn-id: http://core.svn.wordpress.org/trunk@52928 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-03 16:28:09 +00:00
hellofromTonya e9267bf3ee 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.
Built from https://develop.svn.wordpress.org/trunk@53338


git-svn-id: http://core.svn.wordpress.org/trunk@52927 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-03 15:00:36 +00:00
audrasjb 4de4330b17 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.

Built from https://develop.svn.wordpress.org/trunk@53337


git-svn-id: http://core.svn.wordpress.org/trunk@52926 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-03 14:53:09 +00:00
hellofromTonya 7b880889bc 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.
Built from https://develop.svn.wordpress.org/trunk@53336


git-svn-id: http://core.svn.wordpress.org/trunk@52925 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-03 14:33:12 +00:00
Sergey Biryukov 0c9c1d5297 Post WordPress 6.0 Beta 4 version bump.
Built from https://develop.svn.wordpress.org/trunk@53335


git-svn-id: http://core.svn.wordpress.org/trunk@52924 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-02 16:44:10 +00:00
Sergey Biryukov 26d851eefe WordPress 6.0 Beta 4.
Built from https://develop.svn.wordpress.org/trunk@53334


git-svn-id: http://core.svn.wordpress.org/trunk@52923 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-02 16:10:10 +00:00
hellofromTonya 1cca8be49f 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.
Built from https://develop.svn.wordpress.org/trunk@53333


git-svn-id: http://core.svn.wordpress.org/trunk@52922 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-02 14:00:09 +00:00
audrasjb 9d10c963ff 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.

Built from https://develop.svn.wordpress.org/trunk@53332


git-svn-id: http://core.svn.wordpress.org/trunk@52921 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-02 13:32:08 +00:00
Sergey Biryukov 9c76c77398 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.
Built from https://develop.svn.wordpress.org/trunk@53331


git-svn-id: http://core.svn.wordpress.org/trunk@52920 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-02 13:13:08 +00:00
Sergey Biryukov 056bbc95ea 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.
Built from https://develop.svn.wordpress.org/trunk@53330


git-svn-id: http://core.svn.wordpress.org/trunk@52919 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-02 13:07:14 +00:00
gziolo afd35d1958 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.



Built from https://develop.svn.wordpress.org/trunk@53329


git-svn-id: http://core.svn.wordpress.org/trunk@52918 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-02 10:39:04 +00:00
Peter Wilson 0fcdd744c1 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.


Built from https://develop.svn.wordpress.org/trunk@53328


git-svn-id: http://core.svn.wordpress.org/trunk@52917 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-02 02:46:11 +00:00
Peter Wilson 4a7bcc14e4 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.


Built from https://develop.svn.wordpress.org/trunk@53327


git-svn-id: http://core.svn.wordpress.org/trunk@52916 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-02 00:14:29 +00:00
Sergey Biryukov 8267fdc9a2 Tests: Add unit tests for some XML-RPC functions:
* `xmlrpc_getposttitle()`
* `xmlrpc_getpostcategory()`
* `xmlrpc_removepostdata()`

Props pbearne, audrasjb, costdev, SergeyBiryukov.
Fixes #53490.
Built from https://develop.svn.wordpress.org/trunk@53326


git-svn-id: http://core.svn.wordpress.org/trunk@52915 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-02 00:13:12 +00:00
audrasjb 403f9d53f1 Coding standards: Remove extra spaces in docblocks of the `Walker_PageDropdown` class.
Follow-up to [51779].

See #54728.

Built from https://develop.svn.wordpress.org/trunk@53325


git-svn-id: http://core.svn.wordpress.org/trunk@52914 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-01 22:01:10 +00:00
audrasjb df39328035 Docs: Clarify the name and description of some parameters in the `Walker` class.
Follow-up to [53323].
See #54729.

Built from https://develop.svn.wordpress.org/trunk@53324


git-svn-id: http://core.svn.wordpress.org/trunk@52913 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-01 21:47:10 +00:00
audrasjb 9df9561ce9 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.

Built from https://develop.svn.wordpress.org/trunk@53323


git-svn-id: http://core.svn.wordpress.org/trunk@52912 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-01 21:41:12 +00:00
Sergey Biryukov c36f700fda 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.
Built from https://develop.svn.wordpress.org/trunk@53322


git-svn-id: http://core.svn.wordpress.org/trunk@52911 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-01 16:24:14 +00:00
Sergey Biryukov 83c7440590 Tests: Add unit tests for `wp_fuzzy_number_match()`.
Props pbearne, costdev, mukesh27, hellofromTonya, SergeyBiryukov.
Fixes #54239.
Built from https://develop.svn.wordpress.org/trunk@53321


git-svn-id: http://core.svn.wordpress.org/trunk@52910 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-01 16:13:19 +00:00
Sergey Biryukov 7fd2f89da7 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.
Built from https://develop.svn.wordpress.org/trunk@53319


git-svn-id: http://core.svn.wordpress.org/trunk@52908 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-30 11:35:16 +00:00
John Blackbourn bdaba2407c Docs: Improve documentation of the `walker` argument for various functions.
See #54729

Built from https://develop.svn.wordpress.org/trunk@53318


git-svn-id: http://core.svn.wordpress.org/trunk@52907 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-29 19:28:09 +00:00
John Blackbourn cd9aade1bd Docs: Formatting corrections for various docblocks.
See #54729

Built from https://develop.svn.wordpress.org/trunk@53317


git-svn-id: http://core.svn.wordpress.org/trunk@52906 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-29 19:24:09 +00:00
John Blackbourn beac9601fa Docs: Corrections and improvements to docblocks for function and hooks relating to fatal error handling.
See #54729

Built from https://develop.svn.wordpress.org/trunk@53316


git-svn-id: http://core.svn.wordpress.org/trunk@52905 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-29 19:17:11 +00:00
John Blackbourn 98846baff8 REST API: Correct the schema for the `wp/v2/block-directory/search` endpoint.
Props zieladam, TimothyBlynJacobs, spacedmonkey, johnbillion

Fixes #53621

Built from https://develop.svn.wordpress.org/trunk@53315


git-svn-id: http://core.svn.wordpress.org/trunk@52904 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-29 16:55:13 +00:00
Sergey Biryukov 0b930401e0 Docs: Adjust comments in `Gruntfile.js` per the documentation standards.
See #54729.
Built from https://develop.svn.wordpress.org/trunk@53314


git-svn-id: http://core.svn.wordpress.org/trunk@52903 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-29 14:46:11 +00:00
Sergey Biryukov 4fc2b46aa0 Docs: Further clarify a comment for the main part of `wp-login.php`.
Follow-up to [52945].

Fixes #54746.
Built from https://develop.svn.wordpress.org/trunk@53313


git-svn-id: http://core.svn.wordpress.org/trunk@52902 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-29 14:36:10 +00:00
gziolo a972e8131f 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.


Built from https://develop.svn.wordpress.org/trunk@53312


git-svn-id: http://core.svn.wordpress.org/trunk@52901 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-29 14:10:09 +00:00
gziolo 6333a1d971 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.


Built from https://develop.svn.wordpress.org/trunk@53311


git-svn-id: http://core.svn.wordpress.org/trunk@52900 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-29 14:01:10 +00:00
Sergey Biryukov 3070806375 Docs: Remove double spaces in `tests/phpunit/README.txt`.
Props grandeljay.
Fixes #55637.
Built from https://develop.svn.wordpress.org/trunk@53310


git-svn-id: http://core.svn.wordpress.org/trunk@52899 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-29 13:33:09 +00:00
spacedmonkey b00e2a0e89 Taxonomy: Increase cache hits in `WP_Term_Query` when using include and exclude parameters.
Ensure that empty values of include and exclude passed to the parameters of `WP_Term_Query`, reused existing caches by 
resetting values to an empty array. 

Props Spacedmonkey, peterwilsoncc, hellofromtonya.
Follow-up to [52970].
See #55352.


Built from https://develop.svn.wordpress.org/trunk@53309


git-svn-id: http://core.svn.wordpress.org/trunk@52898 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-29 12:36:13 +00:00
Peter Wilson e9850e7225 Bundled Themes: Note visually hidden text for translators.
Indicate the use of screen reader only text in translator comments.

Props sabernhardt.
Fixes #55591.


Built from https://develop.svn.wordpress.org/trunk@53308


git-svn-id: http://core.svn.wordpress.org/trunk@52897 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-29 05:03:11 +00:00
Peter Wilson ef8a32f6b9 Media: Validate track number ID3 tags before use.
Validate current and total track ID3 tags as numeric before use.

Props mjkhajeh, SergeyBiryukov, costdev.
Fixes #55204.


Built from https://develop.svn.wordpress.org/trunk@53307


git-svn-id: http://core.svn.wordpress.org/trunk@52896 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-29 04:50:12 +00:00
Peter Wilson eebb76a64f Install: Prevent DB errors caused by web fonts API.
Bypass checking `theme.json` for web fonts during the installation of WordPress.

During installation the active theme is considered to be Twenty Twenty-Two (the default theme). As a block theme this prompts a database call when the web fonts API checks the `theme.json` settings, this triggers a database error during installation as the database tables do not exist.

Props chouby, costdev, peterwilsoncc, sergeybiryukov.
Fixes #55632.


Built from https://develop.svn.wordpress.org/trunk@53306


git-svn-id: http://core.svn.wordpress.org/trunk@52895 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-29 03:50:14 +00:00
Sergey Biryukov 8e29ebbc16 Docs: Make the `@return` tag for `Translation_Entry::key()` more precise.
Props manooweb.
Fixes #55640.
Built from https://develop.svn.wordpress.org/trunk@53305


git-svn-id: http://core.svn.wordpress.org/trunk@52894 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-28 16:53:09 +00:00
Sergey Biryukov 2334cea3e9 Bootstrap/Load: Move some more administration-related hooks to `admin-filters.php`.
Follow-up to [53266].

Fixes #54795.
Built from https://develop.svn.wordpress.org/trunk@53304


git-svn-id: http://core.svn.wordpress.org/trunk@52893 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-28 16:39:11 +00:00
Mike Schroder d9266d5bfd Media: Ensure `wp_read_image_metadata` filter returns array for `$iptc` and `$exif`.
Makes the behavior of the filter lines up with its documentation.
Previously, both `$iptc` and `$exif` could return `false` when `exif_read_data()` or `iptcparse()` failed.

Now, if those functions do not return an array, the results are explicitly set to `array()`.

Props volodymyrkolesnykov, SergeyBiryukov, sabernhardt, sumitsingh, mikeschroder.
Fixes #54637.
Built from https://develop.svn.wordpress.org/trunk@53303


git-svn-id: http://core.svn.wordpress.org/trunk@52892 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-28 11:00:10 +00:00
John Blackbourn c6dbcf8576 Docs: Various docblock corrections and improvements for changes introduced in 6.0.
See #54729

Built from https://develop.svn.wordpress.org/trunk@53302


git-svn-id: http://core.svn.wordpress.org/trunk@52891 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-28 09:59:13 +00:00
John Blackbourn 13ed66ec88 Mail: Improve the docblocks for actions and functions related to the parsing of authentication cookies.
See #54729

Built from https://develop.svn.wordpress.org/trunk@53301


git-svn-id: http://core.svn.wordpress.org/trunk@52890 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-28 09:54:16 +00:00
John Blackbourn 0d46464f83 Docs: Various docblock corrections.
See #54729

Built from https://develop.svn.wordpress.org/trunk@53300


git-svn-id: http://core.svn.wordpress.org/trunk@52889 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-28 09:49:16 +00:00
John Blackbourn 6aa053dc01 Docs: Various docblock improvements.
See #54729

Built from https://develop.svn.wordpress.org/trunk@53299


git-svn-id: http://core.svn.wordpress.org/trunk@52888 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-28 09:46:21 +00:00
Peter Wilson 4710282f33 Editor: Show comment previews in the Comment Query Loop.
Update `build_comment_query_vars_from_block()` to show previews of unmoderated comments to the original author of the comment. This duplicates the existing logic in `wp_list_comments()`.

Props darerodz, bernhard-reiter, czapla.
Fixes #55634.


Built from https://develop.svn.wordpress.org/trunk@53298


git-svn-id: http://core.svn.wordpress.org/trunk@52887 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-28 01:18:13 +00:00
desrosj b4eb72f714 Build/Test Tools: Update the NPM dependencies to the latest versions.
This updates the following development dependencies:

- `@wordpress/scripts` from `22.4.2` to `22.5.0`.
- `chalk` from `4.1.2` to `5.0.1`.
- `grunt` from `1.4.1` to `1.5.2`.
- `grunt-contrib-clean` from ``2.0.0` to `2.0.1`.
- `grunt-contrib-uglify` from `5.1.0` to `5.2.1`.
- `qunit` from `2.18.1` to `2.18.2`.
- `sass` from `1.50.0` to `1.51.0`.
- `sinon` from `13.0.1` to `13.0.2`.
- `uglify-js` from `3.15.3` to `3.15.4`.

Fixes #54727.
Built from https://develop.svn.wordpress.org/trunk@53297


git-svn-id: http://core.svn.wordpress.org/trunk@52886 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-27 17:21:53 +00:00
desrosj e942432883 External Libraries: Update the `underscore` library to version `1.13.3`.
This is a minor bug fix release.

Fixes #55547.
Built from https://develop.svn.wordpress.org/trunk@53296


git-svn-id: http://core.svn.wordpress.org/trunk@52885 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-27 14:39:21 +00:00
desrosj 3ec9f00b1f Bundled Themes: Update NPM dependencies for default themes.
This updates all NPM dependencies for all default themes with a `package.json` file (Twenty Nineteen, Twenty Twenty, and Twenty Twenty-One) to their latest versions following the defined version constraints. `npm audit fix` has also been run for each theme.

These updates only resulted in minor changes within built files for Twenty Twenty-One.

See #54727.
Built from https://develop.svn.wordpress.org/trunk@53295


git-svn-id: http://core.svn.wordpress.org/trunk@52884 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-27 14:25:07 +00:00
Sergey Biryukov 6e9c29da06 Bootstrap/Load: Avoid a PHP warning when setting the `$pagenow` global in `wp-includes/vars.php`.
In some scenarios where `is_admin()` returns true but `$_SERVER['PHP_SELF']` does not match a `wp-admin/*` location, setting the `$pagenow` global could trigger a PHP warning: `Undefined array key 1`.

This commit avoids the warning by checking whether the matches array is not empty.

Props janh2, konradyoast, peterwilsoncc.
Fixes #54700.
Built from https://develop.svn.wordpress.org/trunk@53294


git-svn-id: http://core.svn.wordpress.org/trunk@52883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-27 13:47:11 +00:00
Peter Wilson 87c8ca71b5 Built tools: Reduce file size of About page texture.
Reduce the file size of the file `src/wp-admin/images/about-texture.png` by running it through the grunt precommit hook.

Other modified files are not included in this commit as there is no change in file size.

See #48703.


Built from https://develop.svn.wordpress.org/trunk@53293


git-svn-id: http://core.svn.wordpress.org/trunk@52882 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-27 05:37:08 +00:00
Peter Wilson da0ce4038f Media: Ensure `wp_crop_image()` returns correct file type.
Return the correct file path from `wp_crop_image()` when a developer modifies the file type with via the `image_editor_output_format` filter.

Previously the function would return a broken file reference containing the original file extension rather than the one specified via the filter.

Props mat-lipe, adamsilverstein.
Fixes #55403.


Built from https://develop.svn.wordpress.org/trunk@53292


git-svn-id: http://core.svn.wordpress.org/trunk@52881 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-27 05:21:08 +00:00
Peter Wilson 75d1fab217 Comments: Avoid DB error in comment meta queries.
In `WP_Comment_Query` always include the table name when referencing `wp_comments.comment_ID`. This avoids ambiguity in when making meta queries as `wp_commentmeta` includes a column of the same name.

Follow up to [47887].

Props genosseeinhorn, azouamauriac, audrasjb, peterwilsoncc.
Fixes #55218.

Built from https://develop.svn.wordpress.org/trunk@53291


git-svn-id: http://core.svn.wordpress.org/trunk@52880 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-27 04:10:08 +00:00
Sergey Biryukov a143b42349 Post WordPress 6.0 Beta 3 version bump.
Built from https://develop.svn.wordpress.org/trunk@53290


git-svn-id: http://core.svn.wordpress.org/trunk@52879 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 16:38:08 +00:00
Sergey Biryukov 24163597f7 WordPress 6.0 Beta 3.
Built from https://develop.svn.wordpress.org/trunk@53289


git-svn-id: http://core.svn.wordpress.org/trunk@52878 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 16:16:08 +00:00
hellofromTonya 8b50004388 Themes: Remove 'gutenberg' as translation context in `_wp_theme_json_webfonts_handler()`.
Follow-up to [53282].

Props kebbet.

See #55567, #46370.
Built from https://develop.svn.wordpress.org/trunk@53288


git-svn-id: http://core.svn.wordpress.org/trunk@52877 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 15:37:09 +00:00
Sergey Biryukov 3c94881cd5 Code Modernization: Rename parameters that use reserved keywords in `wp-includes/deprecated.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 `$echo` parameter to `$display` in:
 * `the_category_ID()`
 * `get_author_link()`
 * `get_links()`
 * `get_category_rss_link()`
 * `get_author_rss_link()`
* Renames the `$string` parameter to `$text` in `wp_specialchars()`.
* Renames the `$string` parameter to `$message` in `debug_fwrite()`.
* Renames the `$string` parameter to `$content` in `wp_kses_js_entities()`.

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].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53287


git-svn-id: http://core.svn.wordpress.org/trunk@52876 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 15:28:07 +00:00
jffng dac4e3be11 Twenty Twenty-Two: Add three style variations.
This commit adds three style variations to Twenty Twenty-Two, allowing users to quickly swap between different visual styles — "Blue", "Pink", and "Swiss" — for the default theme. The variations are previewed and selected from the Site Editor's global styles panel. 

For the implementation, each variation is defined by its own theme.json file within the "/styles" directory of the theme. All variations leverage the internal-only theme.json handler of the Webfonts API [53282] to load locally hosted fonts.

Props kjellr, hellofromtonya.
See #55433.

Built from https://develop.svn.wordpress.org/trunk@53286


git-svn-id: http://core.svn.wordpress.org/trunk@52875 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 15:26:11 +00:00
Sergey Biryukov 39b11dd1f7 Code Modernization: Rename parameters that use reserved keywords in `wp-includes/comment-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 `$class` parameter to `$css_class` in `comment_class()` and `get_comment_class()`.
* Renames the `$echo` parameter to `$display` in `comment_class()`.

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].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53285


git-svn-id: http://core.svn.wordpress.org/trunk@52874 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 15:08:16 +00:00
Sergey Biryukov 9134afa220 Code Modernization: Rename parameters that use reserved keywords in `wp-includes/class.wp-styles.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 `$echo` parameter to `$display` in `WP_Styles` class methods.

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].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53284


git-svn-id: http://core.svn.wordpress.org/trunk@52873 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 14:59:08 +00:00
Sergey Biryukov 6cdf9f1c86 Code Modernization: Rename parameters that use reserved keywords in `wp-includes/class.wp-scripts.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 `$echo` parameter to `$display` in `WP_Scripts` class methods.

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].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53283


git-svn-id: http://core.svn.wordpress.org/trunk@52872 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 14:56:08 +00:00
hellofromTonya 053b9bbd71 Themes: Add internal-only theme.json's webfonts handler (stopgap).
Adds `_wp_theme_json_webfonts_handler()` for handling `fontFace` declarations in a theme's `theme.json` file to generate the `@font-face` styles for both the editor and front-end.

Design notes:
* It is not a public API, but rather an internal, Core-only handler.
* It is a stopgap implementation that will be replaced when the public Webfonts API is introduced in Core.
* The code design is intentional, albeit funky, with the purpose of avoiding backwards-compatibility issues when the public Webfonts API is introduced in Core.
   * It hides the inter-workings.
   * Does not exposing API ins and outs for external consumption.
   * Only works for `theme.json`.
   * Does not provide registration or enqueuing access for plugins.

For more context on the decision to include this stopgap and the Webfonts API, see:
* Core's PR 40493 https://github.com/WordPress/gutenberg/pull/40493
* Gutenberg's tracking issue 40472 https://github.com/WordPress/gutenberg/issues/40472

Props aristath, hellofromTonya, peterwilsoncc, costdev, jffng, zieladam, gziolo, bph, jonoaldersonwp, desrosj.

See #55567, #46370.
Built from https://develop.svn.wordpress.org/trunk@53282


git-svn-id: http://core.svn.wordpress.org/trunk@52871 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 14:48:09 +00:00
Sergey Biryukov a7b2ae76c1 Code Modernization: Rename parameters that use reserved keywords in `wp-includes/class-wp-query.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 `$list` parameter to `$status` in `WP_Dependencies::query()`.

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].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53281


git-svn-id: http://core.svn.wordpress.org/trunk@52870 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 14:28:08 +00:00
Sergey Biryukov 69be4c73ff Docs: Add missing documentation for `WP_*_Query::get_search_sql()` method parameters.
Includes renaming the `$cols` parameter to `$columns` for consistency across the classes.

Follow-up to [42876], [53272-53276].

See #54729.
Built from https://develop.svn.wordpress.org/trunk@53280


git-svn-id: http://core.svn.wordpress.org/trunk@52869 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 14:04:10 +00:00
Sergey Biryukov 5ac4bf5ec6 Docs: Correct alignment for the `customize_nav_menu_available_items` filter DocBlock.
Follow-up to [53245].

See #54729.
Built from https://develop.svn.wordpress.org/trunk@53279


git-svn-id: http://core.svn.wordpress.org/trunk@52868 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 13:44:15 +00:00
gziolo b9f396743c Editor: Update WordPress packages for 6.0 Beta 3
Included cherry-picked commits from the Gutenberg plugin that fix bugs discovere after WordPress 6.0 Beta 2.

Props zieladam, ndiego.
See #55567.


Built from https://develop.svn.wordpress.org/trunk@53278


git-svn-id: http://core.svn.wordpress.org/trunk@52867 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 13:42:07 +00:00
Sergey Biryukov cc6dcc2623 Code Modernization: Rename parameters that use reserved keywords in `wp-includes/class-wp-query.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 `$array` parameter to `$query_vars` in `WP_Query::fill_query_vars()`.
* Renames the `$default` parameter to `$default_value` in `WP_Query::get()`.

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].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53277


git-svn-id: http://core.svn.wordpress.org/trunk@52866 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 13:32:11 +00:00
Sergey Biryukov 901dae255d Code Modernization: Rename parameters that use reserved keywords in `wp-includes/class-wp-user-query.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 `$string` parameter to `$search` in `WP_User_Query::get_search_sql()`.

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].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53276


git-svn-id: http://core.svn.wordpress.org/trunk@52865 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 11:47:26 +00:00
Sergey Biryukov 1c5a65884a Code Modernization: Rename parameters that use reserved keywords in `wp-includes/class-wp-term-query.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 `$string` parameter to `$search` in `WP_Term_Query::get_search_sql()`.

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].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53275


git-svn-id: http://core.svn.wordpress.org/trunk@52864 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 11:46:18 +00:00
Sergey Biryukov e333f174de Code Modernization: Rename parameters that use reserved keywords in `wp-includes/class-wp-site-query.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 `$string` parameter to `$search` in `WP_Site_Query::get_search_sql()`.

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].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53274


git-svn-id: http://core.svn.wordpress.org/trunk@52863 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 11:44:15 +00:00
Sergey Biryukov 27eff4bd87 Code Modernization: Rename parameters that use reserved keywords in `wp-includes/class-wp-network-query.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 `$string` parameter to `$search` in `WP_Network_Query::get_search_sql()`.

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].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53273


git-svn-id: http://core.svn.wordpress.org/trunk@52862 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 11:43:07 +00:00
Sergey Biryukov 84e3a59385 Code Modernization: Rename parameters that use reserved keywords in `wp-includes/class-wp-comment-query.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 `$string` parameter to `$search` in `WP_Comment_Query::get_search_sql()`.

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].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53272


git-svn-id: http://core.svn.wordpress.org/trunk@52861 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 11:41:10 +00:00
Sergey Biryukov adec401ff7 Code Modernization: Rename parameters that use reserved keywords in `wp-includes/class-wp-image-editor.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 `$function` parameter to `$callback` in `WP_Image_Editor::make_image()`.

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].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53271


git-svn-id: http://core.svn.wordpress.org/trunk@52860 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 11:31:07 +00:00
Sergey Biryukov f5f05eb2cc Code Modernization: Rename parameters that use reserved keywords in `wp-includes/class-wp-image-editor-gd.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 `$function` parameter to `$callback` in `WP_Image_Editor_GD::make_image()`.

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].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53270


git-svn-id: http://core.svn.wordpress.org/trunk@52859 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 11:25:08 +00:00
Sergey Biryukov bbf6ffb769 Code Modernization: Rename parameters that use reserved keywords in `wp-includes/class-wp-embed.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 `$match` parameter to `$matches` in `WP_Embed::autoembed_callback()`.

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].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53269


git-svn-id: http://core.svn.wordpress.org/trunk@52858 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 10:00:09 +00:00
gziolo 1dabd8df68 Editor: Register 'lock' attribute for every block on the server
Backports changes from https://github.com/WordPress/gutenberg/pull/40468.

The lock attribute needs to be supported by every block, but currently, it is only done on the client site. As a result, it was causing block rendered API requests to fail when blocks are locked.

Props mamaduka, peterwilsoncc.
See #55567.



Built from https://develop.svn.wordpress.org/trunk@53268


git-svn-id: http://core.svn.wordpress.org/trunk@52857 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 09:50:12 +00:00
audrasjb 22de3f7711 Widgets: Fix Classic Widgets screen toggle response on small screens.
This changeset updates the toogle logic to fix Widget's responsive behavior on Classic Widgets screen.

Props inc2734, kmix39, dlh, desrosj, costdev, Boniu91.
Fixes #48896.

Built from https://develop.svn.wordpress.org/trunk@53267


git-svn-id: http://core.svn.wordpress.org/trunk@52856 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 06:54:09 +00:00
audrasjb 813c4d604c Bootstrap/load: Move administration related hooks to `admin-filters.php`.
This change moves some administration related hooks from `default-filters.php` to `admin-filters.php`. It also updates the `default-filters.php` docblock to indicate that contextualized hooks should be located in the most appropriate place.

Props dlh, hellofromTonya, antonvlasenko, audrasjb, azaozz.
Fixes #54795.

Built from https://develop.svn.wordpress.org/trunk@53266


git-svn-id: http://core.svn.wordpress.org/trunk@52855 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 06:32:08 +00:00
audrasjb 29cc1e94c0 Docs: Use third-person singular verbs for function descriptions in Core Comment API and Comment template functions.
See #54729.

Built from https://develop.svn.wordpress.org/trunk@53265


git-svn-id: http://core.svn.wordpress.org/trunk@52854 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 06:20:08 +00:00
Peter Wilson e9610a5d20 Administration: Trigger a notice for incorrect `add_menu_page()` parameter.
Trigger a notice (via `_doing_it_wrong()`) for developers incorrectly setting the position when calling `add_menu_page()`.

Modify a similar message in `add_submenu_page()` to combine near identical strings and match the error description to the conditions in which it is called.

Follow up to [52569], [53104].

Fixes #40927.

Built from https://develop.svn.wordpress.org/trunk@53264


git-svn-id: http://core.svn.wordpress.org/trunk@52853 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 02:59:08 +00:00
davidbaumwald df148d90fc Twenty Twenty-One: Make translator comments referencing the post title consistent.
Follow-up to [53221].

Props SergeyBiryukov.
Fixes #55564.
Built from https://develop.svn.wordpress.org/trunk@53263


git-svn-id: http://core.svn.wordpress.org/trunk@52852 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-25 23:11:10 +00:00
gziolo 77c9ef30d7 Build: Update the constant used to remove experimental Gutenberg code
We missed the change for blocks that got applied to packages. `process.env.GUTENBERG_PHASE` got renamed to `process.env.IS_GUTENBERG_PLUGIN`.

See #55567.
Follow-up for [53157].


Built from https://develop.svn.wordpress.org/trunk@53262


git-svn-id: http://core.svn.wordpress.org/trunk@52851 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-25 17:03:10 +00:00
gziolo 19d31e1b42 Tests: Update Gallery block unit tests to new gallery format
The Gallery block unit tests still use the old format, so this updates it to the new format that uses nested Image blocks.

Props glendaviesnz.
Fixes #55571.


Built from https://develop.svn.wordpress.org/trunk@53261


git-svn-id: http://core.svn.wordpress.org/trunk@52850 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-25 16:57:10 +00:00
gziolo 32bbe9b0b9 Editor: Fix styles for nested elements (link color)
This fixes an issue by which link color behaves differently in the editor and front end.

Related Gutenberg PR: https://github.com/WordPress/gutenberg/pull/37728.

Props oandregal.
See #55567.


Built from https://develop.svn.wordpress.org/trunk@53260


git-svn-id: http://core.svn.wordpress.org/trunk@52849 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-25 16:37:08 +00:00
gziolo 287662fca1 Editor: Add default comment status to discussion settings
This is a backport that exposes the default_comments_status option in the Editor, under the discussion settings, which then is then used by the Post Comments and Post Comments Form blocks.

Related change in Gutenberg: https://github.com/WordPress/gutenberg/pull/40484.

Props luisherranz.
See #55567.


Built from https://develop.svn.wordpress.org/trunk@53259


git-svn-id: http://core.svn.wordpress.org/trunk@52848 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-25 16:16:10 +00:00
gziolo f7dde1e53a Tests: Add missing unit tests to Comment Template block
Follow-up for [53138], [53172].
Props darerodz.
See #55567.


Built from https://develop.svn.wordpress.org/trunk@53258


git-svn-id: http://core.svn.wordpress.org/trunk@52847 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-25 16:12:09 +00:00
Sergey Biryukov 5097c83eac Code Modernization: Rename parameters that use reserved keywords in `wp-includes/class-wp-customize-widgets.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 `$default` parameter to `$default_value` in `WP_Customize_Widgets` class methods.

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].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53257


git-svn-id: http://core.svn.wordpress.org/trunk@52846 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-25 13:29:09 +00:00
audrasjb 8f93e5f2dd Docs: Use third-person singular verbs for function descriptions in `WP_User_Query` Class, as per docs standards.
See #54729.

Built from https://develop.svn.wordpress.org/trunk@53256


git-svn-id: http://core.svn.wordpress.org/trunk@52845 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-25 13:05:10 +00:00
audrasjb 120f9b9eae Users: Make sure `WP_User_Query` can be filtered using the `fields` parameter.
This change ensures the `fields` parameter is taken into account when running `WP_User_Query` by fixing the conditional statement used to process the `fields` param.

Props rilwis, peterwilsoncc, NomNom99, hellofromTonya, audrasjb, rilwis, Boniu91.
Fixes #53177.

Built from https://develop.svn.wordpress.org/trunk@53255


git-svn-id: http://core.svn.wordpress.org/trunk@52844 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-25 12:57:09 +00:00
audrasjb a74d3ede67 Docs: Use third-person singular verbs for function descriptions in `WP_Theme` Class, as per docs standards.
See #54729.

Built from https://develop.svn.wordpress.org/trunk@53254


git-svn-id: http://core.svn.wordpress.org/trunk@52843 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-25 09:54:07 +00:00
audrasjb 50050b2f59 Themes: Ensure `WP_Theme::get_files()` doesn't return unexpected values.
This change filters out empty entries from `WP_Theme::get_files()` before returning the array of files. This avoid returning an entry with `false` value when the directory of the theme does not exist.

Props dd32, opurockey, Rahmohn, audrasjb.
Fixes #53599.

Built from https://develop.svn.wordpress.org/trunk@53253


git-svn-id: http://core.svn.wordpress.org/trunk@52842 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-25 09:46:08 +00:00
audrasjb 2c0a330fba Docs: Use third-person singular verbs for function descriptions in `wp-includes/nav-menu.php`, as per docs standards.
See #54729.

Built from https://develop.svn.wordpress.org/trunk@53252


git-svn-id: http://core.svn.wordpress.org/trunk@52841 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-25 09:32:09 +00:00
audrasjb dc8a2658e4 Docs: Typo correction in `wp-includes/ms-functions.php` docblock.
See #54729.

Built from https://develop.svn.wordpress.org/trunk@53251


git-svn-id: http://core.svn.wordpress.org/trunk@52840 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-25 09:25:09 +00:00
audrasjb baf41c1fb9 Docs: Use third-person singular verbs for function descriptions in `wp-includes/ms-load.php`, as per docs standards.
See #54729.

Built from https://develop.svn.wordpress.org/trunk@53250


git-svn-id: http://core.svn.wordpress.org/trunk@52839 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-25 09:22:15 +00:00
audrasjb 5d93f8d388 Docs: Use third-person singular verbs for function descriptions in `wp-includes/capabilities.php`, as per docs standards.
Props azouamauriac.
See #54729.


Built from https://develop.svn.wordpress.org/trunk@53249


git-svn-id: http://core.svn.wordpress.org/trunk@52838 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-24 21:32:06 +00:00
audrasjb 365afa3b9c Docs: Use third-person singular verbs for function descriptions in Multisite WordPress API, as per docs standards.
See #54729.

Built from https://develop.svn.wordpress.org/trunk@53248


git-svn-id: http://core.svn.wordpress.org/trunk@52837 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-24 21:28:07 +00:00
audrasjb 9564a68697 Twenty Fifteen: Use `#page` height instead of `body` height in sidebar scroll calculation.
This changeset replaces `bodyHeight = $body.height();` with `bodyHeight = $('#page).height();`. It fixes a JS issue in some specific context, when there is content generated right before the closing `body` tag. For example, this happens when the HTML content is added using the `wp_footer` filter.

Props stephenharris, sabernhardt, audrasjb.
Fixes #40492.

Built from https://develop.svn.wordpress.org/trunk@53247


git-svn-id: http://core.svn.wordpress.org/trunk@52836 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-24 21:03:10 +00:00
Sergey Biryukov 8ca3012db9 Code Modernization: Rename parameters that use reserved keywords in `swp-includes/class-wp-customize-setting.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 `$default` parameter to `$default_value` in `WP_Customize_Setting` class methods.

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].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53246


git-svn-id: http://core.svn.wordpress.org/trunk@52835 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-24 00:28:08 +00:00
Sergey Biryukov ccde5b8bd3 Code Modernization: Rename parameters that use reserved keywords in `wp-includes/class-wp-customize-nav-menus.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 `$type` and `$object` parameters to `$object_type` and `$object_name` in `WP_Customize_Nav_Menus::load_available_items_query()`.

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].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53245


git-svn-id: http://core.svn.wordpress.org/trunk@52834 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-23 20:59:10 +00:00
Sergey Biryukov af5365ff02 Docs: Correct the expected parameter type for `WP_Customize_Manager::remove_preview_signature()`.
Before the method was deprecated, the parameter contained the value passed through for the `wp_die_handler` filter, which expects a callable function. 

Follow-up to [20926], [32535], [34320], [38810], [53242], [53243].

See #54729.
Built from https://develop.svn.wordpress.org/trunk@53244


git-svn-id: http://core.svn.wordpress.org/trunk@52833 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-22 10:56:13 +00:00
Sergey Biryukov 752429a58e Code Modernization: Rename parameters that use reserved keywords in `wp_die_*_handler` filters.
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 `$function` parameter to `$callback` in `wp_die_*_handler` filters, which aims to make it easier to use a non-reserved parameter name for anyone utilizing these filters.

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].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53243


git-svn-id: http://core.svn.wordpress.org/trunk@52832 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-22 10:43:20 +00:00
Sergey Biryukov 2bc70fc658 Code Modernization: Rename parameters that use reserved keywords in `wp-includes/class-wp-customize-manager.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 `$default` parameter to `$default_value` in `WP_Customize_Manager::post_value()`.
* Renames the `$return` parameter to `$callback` in `WP_Customize_Manager::remove_preview_signature()`.

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].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53242


git-svn-id: http://core.svn.wordpress.org/trunk@52831 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-22 10:31:15 +00:00
audrasjb 2b25ad7c7b Build/Test Tools: Typo correction in rss2 unit tests.
Follow-up to [53233].

Props SergeyBiryukov.
Fixes #47968.

Built from https://develop.svn.wordpress.org/trunk@53241


git-svn-id: http://core.svn.wordpress.org/trunk@52830 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-21 23:13:12 +00:00
Sergey Biryukov 01a28c0031 Code Modernization: Rename parameters that use reserved keywords in `wp-includes/block-supports/border.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 `$default` parameter to `$default_value` in `wp_has_border_feature_support()`.

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].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53240


git-svn-id: http://core.svn.wordpress.org/trunk@52829 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-21 21:05:11 +00:00
Sergey Biryukov 88b6ade46a Code Modernization: Rename parameters that use reserved keywords in `wp-includes/atomlib.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 `$string` parameter to `$content` in `AtomParser::xml_escape()`.

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].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53239


git-svn-id: http://core.svn.wordpress.org/trunk@52828 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-21 11:24:17 +00:00
Peter Wilson 7082f4dc84 Posts, Post Types: Fix option validation in `stick_post()`.
Normalize an invalid `sticky_posts` option to an empty array within `stick_post()`. This fixes a bug in which an unexpected option value would prevent new posts from being made sticky.

Follow up to [50380].

Props azouamauriac, denishua, kajalgohel, sergeybiryukov, costdev.
Fixes #55176.


Built from https://develop.svn.wordpress.org/trunk@53238


git-svn-id: http://core.svn.wordpress.org/trunk@52827 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-21 06:04:15 +00:00
Peter Wilson 7821c369eb Tests, Build Tools: Improve version compatibility tests.
Improve tests for `is_wp_version_compatible()` and `is_php_version_compatible()`.

Follow up to [53227].

Props costdev, SergeyBiryukov.
Fixes #54257.


Built from https://develop.svn.wordpress.org/trunk@53237


git-svn-id: http://core.svn.wordpress.org/trunk@52826 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-21 01:02:14 +00:00
Sergey Biryukov 89f24e9c61 Code Modernization: Rename parameters that use reserved keywords in bundled themes.
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 `$class` parameter to `$css_class` in:
 * `twentysixteen_excerpt()`
 * `twentynineteen_post_classes()`
* Renames the `$echo` parameter to `$display` in:
 * `twentythirteen_entry_date()`
 * `twentytwenty_generate_css()`
 * `twentytwenty_site_logo()`
 * `twentytwenty_site_description()`
 * `twenty_twenty_one_generate_css()`

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].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53236


git-svn-id: http://core.svn.wordpress.org/trunk@52825 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-20 14:24:12 +00:00
audrasjb 6ef5625ac2 Docs: Docs: Use third-person singular verbs for function descriptions in `wp-includes/blocks.php` and `wp-includes/script-loader.php`, per the documentation standards.
See #54729.

Built from https://develop.svn.wordpress.org/trunk@53235


git-svn-id: http://core.svn.wordpress.org/trunk@52824 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-20 14:09:11 +00:00
audrasjb 4d3dbe477a Editor: Move `wp_enqueue_block_style()` to `wp-includes/script-loader.php`, for better consistency.
As a result of [52741] and [52743], `wp_enqueue_block_support_styles()` was moved to `wp-includes/script-loader.php`. However, `wp_enqueue_block_style()` was still defined in `wp-includes/blocks.php`. This changeset also moves `wp_enqueue_block_support_styles()` to `wp-includes/script-loader.php` for better consistency.

Follow-up to [52741], [52743].

Props SergeyBiryukov, mukesh27, audrasjb.
Fixes #55182.
See #55148.

Built from https://develop.svn.wordpress.org/trunk@53234


git-svn-id: http://core.svn.wordpress.org/trunk@52823 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-20 13:53:16 +00:00
audrasjb 943e956379 Feeds: Use latest comment date for the `Last-Modified` header of comments feed.
Previously, the `Last-Modified` header of comments feed was using the date/time of the last comment. This behavior was breaking caching and causing feed readers to believe there is no new content even when there might be new posts.

This commit changes this behavior to use the newest date from both `get_lastcommentmodified()` and `get_lastpostmodified()` functions instead of only using the result from `get_lastcommentmodified()`.

Props xiven, mauteri, costdev, audrasjb.
Fixes #47968.

Built from https://develop.svn.wordpress.org/trunk@53233


git-svn-id: http://core.svn.wordpress.org/trunk@52822 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-20 12:47:11 +00:00
Sergey Biryukov 0cc2cb34cd Code Modernization: Rename parameters that use reserved keywords in `wp-admin/install-helper.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 `$default` parameter to `$default_value` in `check_column()`.

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].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53232


git-svn-id: http://core.svn.wordpress.org/trunk@52821 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-20 11:19:12 +00:00
Sergey Biryukov 5fad544f8d Tests: Update the test for `wp_install()` signature.
Follow-up to [53230].

See #55327.
Built from https://develop.svn.wordpress.org/trunk@53231


git-svn-id: http://core.svn.wordpress.org/trunk@52820 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-20 11:06:07 +00:00
Sergey Biryukov 91ad9dbb07 Code Modernization: Rename parameters that use reserved keywords in `wp-admin/includes/upgrade.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 `$public` parameter to `$is_public` in `wp_install()`.

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].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53230


git-svn-id: http://core.svn.wordpress.org/trunk@52819 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-20 10:46:09 +00:00
audrasjb 3d7603869b Docs: Misc fixes and improvements in the Administration Media API docblocks, as per documentation standards.
See #54729.

Built from https://develop.svn.wordpress.org/trunk@53229


git-svn-id: http://core.svn.wordpress.org/trunk@52818 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-20 08:29:08 +00:00
audrasjb aab2815d58 Media: Remove `attachment_fields_to_save` filter and deprecate `image_attachment_fields_to_save()`.
This filter prevented removing attachment titles. This changeset removes the filter and deprecates the related function since it is no longer used.

Props dromero20, desrosj, Junaidkbr, francina, antpb, audrasjb, aadilali, etaproducto, azouamauriac, Boniu91, SergeyBiryukov.
Fixes #39108.

Built from https://develop.svn.wordpress.org/trunk@53228


git-svn-id: http://core.svn.wordpress.org/trunk@52817 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-20 08:13:10 +00:00
Peter Wilson eeedcfac4b Build, Test Tools: Test PHP and WP compatibility functions.
Introduce tests for `is_php_version_compatible()` and `is_wp_version_compatible()`.

Props pbearne, hellofromTonya, mikeschroder, peterwilsoncc, toro_unit.
Fixes #54257.

Built from https://develop.svn.wordpress.org/trunk@53227


git-svn-id: http://core.svn.wordpress.org/trunk@52816 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-20 06:01:09 +00:00
Peter Wilson 1b5dd9b426 Autosave: Compare heartbeat intervals in same unit.
Move the conversion of `minimalInterval` to milliseconds to be grouped with the other time conversions from seconds to milliseconds.

This fixes a bug in which the minimal and main intervals were compared after the former had been converted to milliseconds but the latter had not. This could cause the heatbeat interval to blow out to unexpectedly high values if the minimal interval was set.

Props tabrisrp, sabernhardt, SergeyBiryukov, audrasjb.
Fixes #54825.


Built from https://develop.svn.wordpress.org/trunk@53226


git-svn-id: http://core.svn.wordpress.org/trunk@52815 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-20 05:55:06 +00:00
Peter Wilson 40942c2695 Comments: Improve accuracy of `get_comment_count()` docblock.
Remove reference to uncached database query now `get_comment_count()` uses `WP_Comment_Query` which contains caching. Remove reference to `$wpdb` global, it is no longer used.

Follow up to [53036].

Fixes #19901.

Built from https://develop.svn.wordpress.org/trunk@53225


git-svn-id: http://core.svn.wordpress.org/trunk@52814 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-20 05:53:11 +00:00
Sergey Biryukov 8aef26cfe3 Post WordPress 6.0 Beta 2 version bump.
Built from https://develop.svn.wordpress.org/trunk@53224


git-svn-id: http://core.svn.wordpress.org/trunk@52813 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-19 16:41:08 +00:00
Sergey Biryukov 70fc105ce0 WordPress 6.0 Beta 2.
Built from https://develop.svn.wordpress.org/trunk@53223


git-svn-id: http://core.svn.wordpress.org/trunk@52812 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-19 16:14:10 +00:00
Sergey Biryukov eeb9f68181 Menus: Use correct parameter in `_wp_nav_menu_meta_box_object()`.
Follow-up to [53220].

Props davidbaumwald.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53222


git-svn-id: http://core.svn.wordpress.org/trunk@52811 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-19 15:59:10 +00:00
davidbaumwald 5892153992 Twenty Twenty-One: Correct translator comment in `twenty_twenty_one_continue_reading_text`.
This commit updates the translator comment in `twenty_twenty_one_continue_reading_text` to indicate that the text is visually hidden.  This change also corrects the comment above the `the_content_more_link` filter to reference the content, not the excerpt.

Props sabernhardt, costdev.
Fixes #55564.
Built from https://develop.svn.wordpress.org/trunk@53221


git-svn-id: http://core.svn.wordpress.org/trunk@52810 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-19 15:23:11 +00:00
Sergey Biryukov 9ce061ae8c 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 `$echo` parameter to `$display` in:
 * `wp_popular_terms_checklist()`
 * `_post_states()`
 * `_media_states()`
* Renames the `$default` parameter to `$default_term` in `wp_popular_terms_checklist()`.
* Renames the `$default` parameter to `$default_template` in `page_template_dropdown()`.
* Renames the `$default` parameter to `$default_page` in `parent_dropdown()`.
* Renames the `$object` parameter to `$data_object` in:
 * `do_block_editor_incompatible_meta_box()`
 * `do_meta_boxes()`
 * `do_accordion_sections()`
* Amends the `$item_object` parameter in other functions for consistency:
 * `wp_nav_menu_item_post_type_meta_box()`
 * `wp_nav_menu_item_taxonomy_meta_box()`
 * `_wp_nav_menu_meta_box_object()`

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207], [53215], [53216].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53220


git-svn-id: http://core.svn.wordpress.org/trunk@52809 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-19 15:13:08 +00:00
gziolo 6aead54d17 Editor: Update WordPress packages for 6.0 Beta 2
Included cherry-picked commits from the Gutenberg plugin that fix bugs discovered after WordPress 6.0 Beta 1.

Props zieladam, ndiego.
See #55567.


Built from https://develop.svn.wordpress.org/trunk@53219


git-svn-id: http://core.svn.wordpress.org/trunk@52808 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-19 15:11:17 +00:00
gziolo c795115b0a REST API: Add array argument to getItems for Pattern Directory endopoint
Since http://api.wordpress.org/patterns API supports array parameters, there is no need to implode slug values inside the _register_remote_theme_patterns function.
Both WP_REST_Pattern_Directory_Controller and _register_remote_theme_patternsmust be updated to support array request arguments.

Props antonvlasenko.
Fixes #55574.
Follow-up #55505, [53152].



Built from https://develop.svn.wordpress.org/trunk@53218


git-svn-id: http://core.svn.wordpress.org/trunk@52807 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-19 14:58:09 +00:00
gziolo d2e9cf1f81 REST API: Respect _fields query arg in preloaded requests
Ensures that preloaded request can include a `_fields` query param that asks that only selected response fields are returned.

Props jsnajdr, timothyblynjacobs. 
Fixes #55213.
See #55567.


Built from https://develop.svn.wordpress.org/trunk@53217


git-svn-id: http://core.svn.wordpress.org/trunk@52806 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-19 14:40:09 +00:00
Sergey Biryukov 05d12bfa4c Code Modernization: Rename parameters that use reserved keywords in `wp-admin/includes/taxonomy.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 `$category_parent` in `category_exists()` and `wp_create_category()`. This matches the category object property of the same name.
* Amends similar parameters in `dropdown_categories()` and `wp_dropdown_cats()` for consistency.

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207], [53215].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53216


git-svn-id: http://core.svn.wordpress.org/trunk@52805 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-19 13:51:08 +00:00
Sergey Biryukov 90cbd98c6b Code Modernization: Rename parameters that use reserved keywords in `wp-admin/includes/plugin.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 `$function` parameter to `$callback` in:
 * `add_menu_page()`
 * `add_submenu_page()`
 * `add_management_page()`
 * `add_options_page()`
 * `add_theme_page()`
 * `add_plugins_page()`
 * `add_users_page()`
 * `add_dashboard_page()`
 * `add_posts_page()`
 * `add_media_page()`
 * `add_links_page()`
 * `add_pages_page()`
 * `add_comments_page()`
* Renames the `$echo` parameter to `$display` in `menu_page_url()`.
* Renames the `$parent` parameter to `$parent_page` in `get_admin_page_parent()`.

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53215


git-svn-id: http://core.svn.wordpress.org/trunk@52804 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-19 12:48:08 +00:00
gziolo ec0574144a Editor: Fix Comment Query block isn't lazy loading meta data
Related GitHub issue: https://github.com/WordPress/gutenberg/issues/40241.
Primes comment meta data cache within calls to WP_Comment_Query.

Props peterwilsoncc, cbravobernal.
See #55567.
Follow-up [53138].



Built from https://develop.svn.wordpress.org/trunk@53214


git-svn-id: http://core.svn.wordpress.org/trunk@52803 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-19 12:39:09 +00:00
gziolo 5cc972ba4a Editor: Include the PHP file for the Cover block
This file is copied by the build process but it also needs to be versioned so unit tests can run without issues.

Follow-up [53212].
See #55580.


Built from https://develop.svn.wordpress.org/trunk@53213


git-svn-id: http://core.svn.wordpress.org/trunk@52802 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-19 11:51:07 +00:00
gziolo 87207e9ca5 Editor: Correctly register the dynamic Cover block
The new "Featured Image" enhancement is handled dynamically, so we need to update how the Cover block is handled in the build processa and registered in the code.

Props ironprogrammer, costdev, Mamaduka, chaion07.
Fixes #55580.


Built from https://develop.svn.wordpress.org/trunk@53212


git-svn-id: http://core.svn.wordpress.org/trunk@52801 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-19 11:37:12 +00:00
gziolo 83aed3ea4f Code Quality: Fix reported undefined `$script_uri` variable notice
The code editor reported this issue while mamduka was browsing the blocks.php file. PHP considers variables undefined until a value is assigned (or the global keyword is used).

Follow-up for [53091].
Props mamaduka, peterwilsoncc.
See 55567.


Built from https://develop.svn.wordpress.org/trunk@53211


git-svn-id: http://core.svn.wordpress.org/trunk@52800 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-19 09:58:07 +00:00
gziolo fba03a16ca REST API: Add `inserter` field to the schema of Patterns endpoint
Backports changes from https://github.com/WordPress/gutenberg/pull/40416. Adds the missing `inserter` field to the Patterns item schema. This field was omitted from the response, and patterns that should be hidden in the inserter were visible.

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



Built from https://develop.svn.wordpress.org/trunk@53210


git-svn-id: http://core.svn.wordpress.org/trunk@52799 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-19 09:41:09 +00:00
gziolo 09688edc45 REST API: Don't load remote patterns twice in the controller
This PR aims to fix an issue with fetching remote patterns multiple times inside the WP_REST_Block_Patterns_Controller::get_items method.

Follow-up [53152].

Props antonvlasenko.
See #55567.



Built from https://develop.svn.wordpress.org/trunk@53209


git-svn-id: http://core.svn.wordpress.org/trunk@52798 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-19 09:28:12 +00:00
jorgefilipecosta 0559e94375 Block editor: Prevent styles from being added in the site editor.
The site editor, unlike other editors, generates the styles coming from global styles (presets, styles) dynamically in the client. This is because the user can modify any value that we need to consolidate (merge core, theme, and user style preferences). We don't want to have the global styles twice, as it introduces subtle bugs.

Props oandregal, youknowriad.
See #55567.
Built from https://develop.svn.wordpress.org/trunk@53208


git-svn-id: http://core.svn.wordpress.org/trunk@52797 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-18 17:12:07 +00:00
Sergey Biryukov c4c4edccc0 Code Modernization: Rename parameters that use reserved keywords in `wp-admin/includes/nav-menu.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 `$echo` parameter to `$display` in `wp_nav_menu_disabled_check()`.
* Renames the `$object` parameter to `$item_object` in:
 * `wp_nav_menu_item_post_type_meta_box()`
 * `wp_nav_menu_item_taxonomy_meta_box()`
 * `_wp_nav_menu_meta_box_object()`

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53207


git-svn-id: http://core.svn.wordpress.org/trunk@52796 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-18 15:22:08 +00:00
audrasjb 57fba4946f Docs: Replace Codex links with the corresponding page on DevHub.
The Codex page for `WP_Object_Cache` already redirects to the corresponding DevHub page.

See #54729.

Built from https://develop.svn.wordpress.org/trunk@53206


git-svn-id: http://core.svn.wordpress.org/trunk@52795 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-18 15:08:09 +00:00
audrasjb 3b2c1e5629 Docs: Update a link to the Custom Elements spec in `unsupported_valid_tag_names()` unit test docblock.
This changeset replaces a link to the outdated W3C specs on Custom Elements with a link to the corresponding WhatWG specification.

Follow-up to [53204].

See #54729.

Built from https://develop.svn.wordpress.org/trunk@53205


git-svn-id: http://core.svn.wordpress.org/trunk@52794 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-18 14:43:08 +00:00
audrasjb eca9278a10 Docs: Update a link to the Custom Elements spec in `force_balance_tags()` docblock.
This changeset replaces a link to the outdated W3C specs on Custom Elements with a link to the corresponding WhatWG specification.

See #54729.

Built from https://develop.svn.wordpress.org/trunk@53204


git-svn-id: http://core.svn.wordpress.org/trunk@52793 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-18 14:35:07 +00:00
Sergey Biryukov f53b215bfe Code Modernization: Rename parameters that use reserved keywords in `wp-admin/includes/ms.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 `$echo` parameter to `$display_message` in `upload_is_user_over_quota()`.

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53203


git-svn-id: http://core.svn.wordpress.org/trunk@52792 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-18 10:33:09 +00:00
audrasjb b6c2df9325 Docs: Update MDN link in `send_frame_options_header()` docblock.
The X-Frame-Options MDN documentation has been moved to `/docs/Web/HTTP/Headers/X-Frame-Options`. This changeset updates the link accordingly.

See #54729.

Built from https://develop.svn.wordpress.org/trunk@53202


git-svn-id: http://core.svn.wordpress.org/trunk@52791 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-18 10:18:10 +00:00
Sergey Biryukov 99de4aea45 Docs: Use third-person singular verbs for function descriptions in `wp-admin/includes/meta-boxes.php`, per the documentation standards.
See #54729.
Built from https://develop.svn.wordpress.org/trunk@53201


git-svn-id: http://core.svn.wordpress.org/trunk@52790 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-17 17:57:09 +00:00
Sergey Biryukov 9043ef83ef Docs: Add missing descriptions for function parameters in `wp-admin/includes/meta-boxes.php`.
See #54729.
Built from https://develop.svn.wordpress.org/trunk@53200


git-svn-id: http://core.svn.wordpress.org/trunk@52789 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-17 17:47:13 +00:00
Sergey Biryukov 6c36a0867d Coding Standards: Simplify long conditions in `xfn_check()`.
Add some comments for clarity.

Follow-up to [2051], [4990], [53198].

See #54728.
Built from https://develop.svn.wordpress.org/trunk@53199


git-svn-id: http://core.svn.wordpress.org/trunk@52788 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-17 17:26:08 +00:00
Sergey Biryukov 447bd92f5d Code Modernization: Rename parameters that use reserved keywords in `wp-admin/includes/meta-boxes.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 `$class` parameter to `$xfn_relationship` in `xfn_check()`.
* Renames the `$value` parameter to `$xfn_value` for clarity.
* Includes minor code layout changes for better readability.

Reference: [http://gmpg.org/xfn/join XFN: Getting Started].

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53198


git-svn-id: http://core.svn.wordpress.org/trunk@52787 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-17 15:37:09 +00:00
Sergey Biryukov e0d13f8b59 Coding Standards: Correct alignment in various files.
This fixes an `Array double arrow not aligned correctly` WPCS warning.

Follow-up to [53075], [53084], [53091], [53094], [53155], [53129].

See #54728.
Built from https://develop.svn.wordpress.org/trunk@53197


git-svn-id: http://core.svn.wordpress.org/trunk@52786 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-17 15:07:08 +00:00
Sergey Biryukov 8a6d7ea5ac Coding Standards: Correct the `$items_count` variable in `add_menu_classes()`.
Follow-up to [53195].

See #54728.
Built from https://develop.svn.wordpress.org/trunk@53196


git-svn-id: http://core.svn.wordpress.org/trunk@52785 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-17 14:44:07 +00:00
Sergey Biryukov b32080c332 Coding Standards: Use more descriptive variable names in `add_menu_classes()`.
Follow-up to [9578], [53193], [53194].

See #54728.
Built from https://develop.svn.wordpress.org/trunk@53195


git-svn-id: http://core.svn.wordpress.org/trunk@52784 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-17 14:41:08 +00:00
Sergey Biryukov a30a1efac4 Docs: Add missing documentation for `add_cssclass()` and `add_menu_classes()`.
Follow-up to [9578], [53193].

See #54729.
Built from https://develop.svn.wordpress.org/trunk@53194


git-svn-id: http://core.svn.wordpress.org/trunk@52783 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-17 14:30:13 +00:00
Sergey Biryukov f6b7a1fd7a Code Modernization: Rename parameters that use reserved keywords in `wp-admin/includes/menu.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 `$class` parameter to `$classes` in `add_cssclass()`.
* Renames the `$add` parameter to `$class_to_add` for clarity.
* Includes minor code layout changes for better readability. 

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53193


git-svn-id: http://core.svn.wordpress.org/trunk@52782 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-17 14:10:07 +00:00
Sergey Biryukov 88cce3c705 Code Modernization: Rename parameters that use reserved keywords in `wp-admin/includes/media.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 `$return` parameter to `$return_type` in `media_sideload_image()`.

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53192


git-svn-id: http://core.svn.wordpress.org/trunk@52781 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-17 10:51:10 +00:00
audrasjb 9998c01dca Themes: Use consistent thumbnail sizes in Customizer preview screen.
This ensures displaying theme thumbnails in consistent sizes in Customizer theme preview.

Props poena, karpstrucking, costdev, audrasjb.
Fixes #54188.

Built from https://develop.svn.wordpress.org/trunk@53191


git-svn-id: http://core.svn.wordpress.org/trunk@52780 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-16 06:15:09 +00:00
Sergey Biryukov 36708d062c I18N: Move code out of a translatable string in `WP_Theme::__construct()`.
Props kapilpaul, azouamauriac, SergeyBiryukov.
Fixes #55405.
Built from https://develop.svn.wordpress.org/trunk@53190


git-svn-id: http://core.svn.wordpress.org/trunk@52779 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-16 00:30:11 +00:00
audrasjb 407e802048 Docs: Use third-person singular verbs for function descriptions in `author-template.php`, as per documentation standards.
See #54729.

Built from https://develop.svn.wordpress.org/trunk@53189


git-svn-id: http://core.svn.wordpress.org/trunk@52778 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-15 15:14:09 +00:00
audrasjb 6d0458e78c Docs: Fix a docblock typo in `get_the_modified_author`.
Follow-up to [53187].

See #55420.

Built from https://develop.svn.wordpress.org/trunk@53188


git-svn-id: http://core.svn.wordpress.org/trunk@52777 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-15 13:55:10 +00:00
audrasjb ed59d4f043 Users: Avoid warning on `the_modified_author` when `get_userdata()` returns `false`.
This change adds a check of the value returned by `get_userdata()` before using it in `get_the_modified_author()`. It avoids a warning when retrieving the last author who edited the current post.

Props juanlopez4691, mukesh27.
Fixes #55420.

Built from https://develop.svn.wordpress.org/trunk@53187


git-svn-id: http://core.svn.wordpress.org/trunk@52776 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-15 13:47:12 +00:00
audrasjb f087315090 Text Changes: Fix various inconsistent capitalization issues.
Props Presskopp, arpitgshah, mukesh27, desrosj, audrasjb, marybaum.
Fixes #53028.

Built from https://develop.svn.wordpress.org/trunk@53186


git-svn-id: http://core.svn.wordpress.org/trunk@52775 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-15 11:58:10 +00:00
Sergey Biryukov ad5deed830 Code Modernization: Rename parameters that use reserved keywords in `wp-admin/includes/list-table.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 `$class` parameter to `$class_name` in `_get_list_table()`.

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53185


git-svn-id: http://core.svn.wordpress.org/trunk@52774 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-15 10:52:11 +00:00
Sergey Biryukov e86b90cad6 Code Modernization: Rename parameters that use reserved keywords in `wp-admin/includes/deprecated.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 `$default` and `$parent` parameters to `$default_category` and `$parent_category` in `dropdown_categories()`.
* Renames the `$default` parameter to `$default_link_category` in `dropdown_link_categories()`.
* Renames the `$parent` parameter to `$parent_cat` and some other parameters for consistency in `wp_dropdown_cats()`.
* Renames the `$function` to `$callback` in `add_object_page()` and `add_utility_page()`.

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53184


git-svn-id: http://core.svn.wordpress.org/trunk@52773 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-14 15:26:09 +00:00
Sergey Biryukov 9a9617ea72 Coding Standards: Rename the `$object` variable to `$attachment` in several files.
This brings some consistency with a similar fragment in `Custom_Image_Heade::step_2_manage_upload()`, `WP_Site_Icon::insert_attachment()`, `media_handle_upload()`, and clarifies the type of the data.

Follow-up to [52946], [53137].

See #55327, #54728.
Built from https://develop.svn.wordpress.org/trunk@53183


git-svn-id: http://core.svn.wordpress.org/trunk@52772 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-14 15:15:12 +00:00
audrasjb c57fd8ae09 Help/about: Improve text in help tabs of the Personal Data Exporter/Eraser.
This change clarifies the purpose of the personal data exporter/eraser tool in the related help tab.

Props dimadin, peterwilsoncc, audrasjb, marybaum, webcommsat, azaozz, paapst, desrosj.
Fixes #52970.

Built from https://develop.svn.wordpress.org/trunk@53182


git-svn-id: http://core.svn.wordpress.org/trunk@52771 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-14 14:46:07 +00:00
audrasjb 80aea1734c Plugins: Avoid translating empty plugin headers.
This change aims to avoid unnecessarily translating empty strings from plugin headers, by removing empty fields from translation process in `_get_plugin_data_markup_translate()`.

Props Chouby, johnbillion, audrasjb.
Fixes #54586.

Built from https://develop.svn.wordpress.org/trunk@53181


git-svn-id: http://core.svn.wordpress.org/trunk@52770 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-14 13:26:12 +00:00
audrasjb 44e4439d68 Docs: Removes an irrelevant `@link` mention in `Translation_Entry` Class.
See #54729.

Built from https://develop.svn.wordpress.org/trunk@53180


git-svn-id: http://core.svn.wordpress.org/trunk@52769 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-14 09:18:08 +00:00
audrasjb c5a34f9397 Docs: Misc. Docblocks improvements in the Core User API.
See #54729.

Built from https://develop.svn.wordpress.org/trunk@53179


git-svn-id: http://core.svn.wordpress.org/trunk@52768 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-14 07:08:08 +00:00
audrasjb 050a2947cf Users: Update parameters passed to the new `send_retrieve_password_email` and `retrieve_password_notification_email` filters.
For consistency with some similar filters like `send_password_change_email` or `send_email_change_email`, and for more flexibility, pass `$user_login` and `$user_data` parameters directly to the new `send_retrieve_password_email` and `retrieve_password_notification_email` filters.

Follow-up to [52604], [52605], [52606], [52607].

Props SergeyBiryukov, costdev, peterwilsoncc.
Fixes #54690.

Built from https://develop.svn.wordpress.org/trunk@53178


git-svn-id: http://core.svn.wordpress.org/trunk@52767 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-14 06:24:10 +00:00
audrasjb ecce0c2f57 Docs: Small fixes in `WP_Theme_JSON_Resolver` docblocks, as per documentation standards.
See #54729.

Built from https://develop.svn.wordpress.org/trunk@53177


git-svn-id: http://core.svn.wordpress.org/trunk@52766 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-14 06:15:09 +00:00
audrasjb 39052a81e6 Docs: Fix `@link` URLs in `get_merged_data()` Docblock.
This addresses some 404s found on Helphub links by replacing the related `@link` sources.

See #54729.

Built from https://develop.svn.wordpress.org/trunk@53176


git-svn-id: http://core.svn.wordpress.org/trunk@52765 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-14 06:05:11 +00:00
Sergey Biryukov ed4829b0ee Query: Restore late `compact()` call for SQL clauses in `wp-includes/class-wp-*-query.php`.
This addresses a backward compatibility break where `posts_groupby` and other filters were applied, but their results were subsequently discarded and earlier values were used instead.

Follow-up to [52974].

Props nextend_ramona.
See #54728, #meta6273.
Built from https://develop.svn.wordpress.org/trunk@53175


git-svn-id: http://core.svn.wordpress.org/trunk@52764 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-14 00:04:11 +00:00
Sergey Biryukov c6a5a33e54 Code Modernization: Rename parameters that use reserved keywords in `wp-admin/includes/class-wp-terms-list-table.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_term` in `WP_Terms_List_Table::_rows()`.

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53174


git-svn-id: http://core.svn.wordpress.org/trunk@52763 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-13 16:14:10 +00:00
desrosj f448f54be5 Script Loader: Specify the version of the `clipboard` library included when registering.
For external libraries, the current version included with WordPress should be specified when registering scripts.

Props elifvish.
Fixes #55565.
Built from https://develop.svn.wordpress.org/trunk@53173


git-svn-id: http://core.svn.wordpress.org/trunk@52762 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-13 15:58:08 +00:00
gziolo cf490c773c Tests: Add unit tests for rendering in Comment Template block
Follow-up [53138].

Props darerodz.
See #55505.


Built from https://develop.svn.wordpress.org/trunk@53172


git-svn-id: http://core.svn.wordpress.org/trunk@52761 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-13 07:49:10 +00:00
gziolo 4549da16cc REST API: Fix incorrect casing of patterns endpoint schema properties
Follow-up [53154].

Props talldanwp.
See #55505.


Built from https://develop.svn.wordpress.org/trunk@53171


git-svn-id: http://core.svn.wordpress.org/trunk@52760 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-13 07:06:17 +00:00
Peter Wilson 74dcee85d0 Docs: Improve doc blocks for hooks added in [53126].
Fix a variable name and provide examples of the hook names.

Follow up to [53126].

Props dlh, pbiron.
Fixes #53212.

Built from https://develop.svn.wordpress.org/trunk@53170


git-svn-id: http://core.svn.wordpress.org/trunk@52759 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-13 03:04:10 +00:00
Peter Wilson 4b73e7b87b Cache API: Improve cache key generation in `WP_Comment_Query`.
Discard the parameters `update_comment_meta_cache` and `update_comment_post_cache` when generating the cache key as neither have an effect on the database query generated.

Props uday17035, spacedmonkey.
Fixes #55460.


Built from https://develop.svn.wordpress.org/trunk@53169


git-svn-id: http://core.svn.wordpress.org/trunk@52758 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-13 02:57:14 +00:00
davidbaumwald 2ea5eb36fe Taxonomy: Only reset non-button form field values after adding a tag.
[52953] added HTML5 input types to the form reset after a tag is created.  The selector was a bit too greedy, causing `button` types to have their values reset also.  

This change updates the jQuery selector to exclude `button`, `submit`, and `reset` input types from the form reset.

Follow-up to [52953].

Props peterwilsoncc.
Fixes #48030.
Built from https://develop.svn.wordpress.org/trunk@53168


git-svn-id: http://core.svn.wordpress.org/trunk@52757 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-12 19:37:14 +00:00
Sergey Biryukov e1a2ae351a Post WordPress 6.0 Beta 1 version bump.
Built from https://develop.svn.wordpress.org/trunk@53167


git-svn-id: http://core.svn.wordpress.org/trunk@52756 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-12 19:05:15 +00:00
Sergey Biryukov 2be90dc589 WordPress 6.0 Beta 1.
Built from https://develop.svn.wordpress.org/trunk@53166


git-svn-id: http://core.svn.wordpress.org/trunk@52755 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-12 18:15:10 +00:00
desrosj 43ca7ac938 External Libraries: Update polyfill libraries.
This updates two polyfill libraries to their latest versions.

- `polyfill-library` from `3.105.0` to `4.0.0`.
- `formdata-polyfill` from `4.0.0` to `4.0.10`.

This will affect the following script handles:
- `wp-polyfill-formdata`
- `wp-polyfill-node-contains`
- `wp-polyfill-dom-rect`

These polyfills are no longer used by WordPress Core, but are kept up to date as a courtesy for any plugins or themes still requiring them.

See #55547.
Built from https://develop.svn.wordpress.org/trunk@53165


git-svn-id: http://core.svn.wordpress.org/trunk@52754 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-12 17:35:27 +00:00
desrosj 35005412d0 External Libraries: Update some external libraries.
This updates three external libraries to their latest versions:

- `backbone` from `1.4.0` to `1.4.1`.
- `underscore` from `1.13.1` to `1.13.2`.
- `clipboard` from `2.0.8` to `2.0.10`.

These are all minor updates containing bug fixes and documentation improvements.

See #55547.
Built from https://develop.svn.wordpress.org/trunk@53164


git-svn-id: http://core.svn.wordpress.org/trunk@52753 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-12 17:17:22 +00:00
desrosj e15e2d78bf External Libraries: Update `moment` to version `2.29.2`.
See #55547.
Built from https://develop.svn.wordpress.org/trunk@53163


git-svn-id: http://core.svn.wordpress.org/trunk@52752 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-12 16:52:23 +00:00
joedolson fd9d7a7547 Media: Fix editing controls covering image edit region.
Move the editing control sidebar for mobile image editing below the image edit region so image is not obscured.

Props mor10, HristoK, certainstrings, joedolson.
Fixes #30154.
Built from https://develop.svn.wordpress.org/trunk@53162


git-svn-id: http://core.svn.wordpress.org/trunk@52751 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-12 16:50:08 +00:00
joedolson 1d29cb6632 Media: Enable edits to custom image sizes.
Add a filter `edit_custom_thumbnail_sizes` to allow users to enable editing individual custom image sizes.

Props silb3r, joedolson, costdev.
Fixes #28277.
Built from https://develop.svn.wordpress.org/trunk@53161


git-svn-id: http://core.svn.wordpress.org/trunk@52750 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-12 16:16:08 +00:00
gziolo 1882e40a8a Editor: Use block settings to pass assets for the iframed editor
Backports changes applied in Gutenberg in https://github.com/WordPress/gutenberg/pull/37193.

Props zieladam.
See #55505.
Follow-up for [53157].


Built from https://develop.svn.wordpress.org/trunk@53160


git-svn-id: http://core.svn.wordpress.org/trunk@52749 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-12 16:02:19 +00:00
joedolson 4dd4aec2d1 Administration: Add unit test for term supplementary notice.
Adds a new test assertion to handle the supplemental data array passed in `ajax-response.js`. 

Follow up to [53123].

Props SergeyBiryukov, peterwilsoncc.
Fixes #55078.
Built from https://develop.svn.wordpress.org/trunk@53159


git-svn-id: http://core.svn.wordpress.org/trunk@52748 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-12 16:01:08 +00:00
audrasjb bb723f9920 Widgets: Avoid 27 duplicate translations in Media Widgets constructor.
This changeset rationalizes the declaration of translation strings in the Media Widgets constructor.

Props Chouby, audrasjb, peterwilsoncc, costdev.
Fixes #54561.

Built from https://develop.svn.wordpress.org/trunk@53158


git-svn-id: http://core.svn.wordpress.org/trunk@52747 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-12 15:40:11 +00:00
gziolo ab8a964858 Editor: Update WordPress packages based based on Gutenberg v13.0 RC3
This is the last step of backports from the Gutenberg plugin for WordPress 6.0 Beta 1 release. It includes all updates WordPress packages published to npm based on the Gutenberg plugin v13.0 RC3 release. This patch also includes all the necessary changes applied to core blocks. New blocks included:

- Avatar
- Comment Author Name
- Comment Content
- Comment Date
- Comment Edit Link
- Comment Rely Link
- Comment Template
- Comments Pagination
- Comments Pagination Next
- Comments Pagination Previous
- Comments Query Loop
- Home Link
- Post Author Biography
- Query No Results
- Read More
See more details in https://github.com/WordPress/wordpress-develop/pull/2564.

Props zieladam, ramonopoly, ocean90.
Fixes #55505.


Built from https://develop.svn.wordpress.org/trunk@53157


git-svn-id: http://core.svn.wordpress.org/trunk@52746 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-12 15:12:47 +00:00
audrasjb bc0f186599 Administration: Clarify some sentences after [53131].
Props SergeyBiryukov, costdev, audrasjb.
Fixes #46057.

Built from https://develop.svn.wordpress.org/trunk@53156


git-svn-id: http://core.svn.wordpress.org/trunk@52745 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-12 13:43:16 +00:00
gziolo e81c1a0267 Editor: Remove block patterns from server-generated settings
Backport of https://github.com/WordPress/gutenberg/pull/39185 from the Gutenberg plugin. Namely the part where the `gutenberg_remove_block_patterns_settings` filter function removes the block patterns fields from settings.

Props jsnajdr, zieladam.
See #55505.
Follow-up for [53152].


Built from https://develop.svn.wordpress.org/trunk@53155


git-svn-id: http://core.svn.wordpress.org/trunk@52744 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-12 13:00:14 +00:00
gziolo 34e9aca0ca REST API: Use snake case convention for field names in Block Patterns
Backports the same changes applied in Gutenberg: https://github.com/WordPress/gutenberg/pull/40254.

Follow-up for [53152].

Props jsnajdr, timothyblynjacobs.
See #55505.


Built from https://develop.svn.wordpress.org/trunk@53154


git-svn-id: http://core.svn.wordpress.org/trunk@52743 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-12 12:48:18 +00:00
gziolo e1414c93ca Tests: Improve test cleanup for block supports
Let's unregister the block in the tear_down method. The block will be unregistered even if the test fails.

Props ramonopoly, antonvlasenko.
See #55505.
Follow-up [53085], [53076].


Built from https://develop.svn.wordpress.org/trunk@53153


git-svn-id: http://core.svn.wordpress.org/trunk@52742 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-12 09:40:11 +00:00
gziolo 68a36de460 REST API: Bring new endpoints for Block Patterns from Gutenberg plugin
Related Gutenberg issue: https://github.com/WordPress/gutenberg/issues/39889.

Backporting changes from the Gutenberg plugin:
- new Block Patterns REST API endpoint
- new Block Pattern Categories REST API endpoint
- updates to Query Loop related patterns
- support for custom taxonomies in Query Loop block

Props hellofromtonya, peterwilsoncc, ntsekouras, zieladam, ironprogrammer, spacedmonkey, timothyblynjacobs, antonvlasenko, jsnajdr.
See #55505.



Built from https://develop.svn.wordpress.org/trunk@53152


git-svn-id: http://core.svn.wordpress.org/trunk@52741 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-12 09:26:16 +00:00
Peter Wilson 5703931172 Options: Show error when updating all options exceeds `max_input_vars`.
On sites with a large number of options, the number of inputs when saving all options via the /wp-admin/options.php page may exceed PHP's `max_input_vars` setting, this will prevent saving.

An error is now shown if this is the case.

Props ishitaka, jorbin, maguijo, pento, sergeybiryukov. 
Fixes #45438.

Built from https://develop.svn.wordpress.org/trunk@53151


git-svn-id: http://core.svn.wordpress.org/trunk@52740 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-12 06:07:08 +00:00
Peter Wilson b53f7ce56f Emoji: Update the Twemoji to version 14.0.2.
This version introduces support for the latest Emoji added in Emoji 14. 

"Insert witty comment newly supported emoji."

Props kraftbj, desrosj, dd32, milana_cap.
Fixes #55395.



Built from https://develop.svn.wordpress.org/trunk@53150


git-svn-id: http://core.svn.wordpress.org/trunk@52739 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-12 05:56:23 +00:00
Peter Wilson fadb4e1ea3 Media: Run the `wp_content_img_tag` filter once per image.
Prevent multiple identical `img` tags in a block of content causing the `wp_content_img_tag` filter to fire multiple times for that image.

Follow up to [53028].

Props superpoincare, flixos90, pbearne, peterwilsoncc.
Fixes #55510.
See #55347.

Built from https://develop.svn.wordpress.org/trunk@53149


git-svn-id: http://core.svn.wordpress.org/trunk@52738 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-12 05:18:08 +00:00
Sergey Biryukov 561518cdd7 I18N: Remove `wp-config.php` file name from translatable strings.
Follow-up to [35547], [35557], [53131].

See #46057.
Built from https://develop.svn.wordpress.org/trunk@53148


git-svn-id: http://core.svn.wordpress.org/trunk@52737 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-12 01:47:07 +00:00
davidbaumwald ce4a2a11de Formatting: Make `get_the_author_link` pluggable.
Adds a new filter to alter the output of `get_the_author_link`.  This change also adds unit tests for the new filter.

Props dshanske, donmhico, audrasjb, peterwilsoncc, SergeyBiryukov.
Fixes #51859.
Built from https://develop.svn.wordpress.org/trunk@53147


git-svn-id: http://core.svn.wordpress.org/trunk@52736 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 23:38:08 +00:00
audrasjb fcb19b1c42 Docs: Misc. docblock fixes in `wp-admin/includes/mic.php`, as per documentation standards.
See #54729.

Built from https://develop.svn.wordpress.org/trunk@53146


git-svn-id: http://core.svn.wordpress.org/trunk@52735 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 21:48:09 +00:00
audrasjb 476e73194d Users: Improve wording of the "New Admin Email Address" email.
This changeset clarifies the email that the user gets when someone change the administration email address.

Props TwisterMc, Presskopp, audrasjb.
Fixes #45915.

Built from https://develop.svn.wordpress.org/trunk@53145


git-svn-id: http://core.svn.wordpress.org/trunk@52734 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 21:34:08 +00:00
audrasjb 70dea8e3c2 Formatting: Avoid escaping valid XML values in `esc_xml()`.
This change improves the `esc_xml()` function by replacing two `empty()` checks with `isset()` to cover values that are not equal to `''` but still returning `true` when checked with `empty()`, like `'0'`, `0` or `false`. It also updates the related unit tests accordingly.

Props rumpel2116, pbiron.
Fixes #55399.

Built from https://develop.svn.wordpress.org/trunk@53144


git-svn-id: http://core.svn.wordpress.org/trunk@52733 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 20:00:09 +00:00
desrosj 523c679e76 Build/Test Tools: Update generated CSS files after [53141].
This removes 2 instances of `-moz-tab-size`, which has not been required for Firefox to support the `tab-size` property since version 90 (current version is 99.

See #55559.
Built from https://develop.svn.wordpress.org/trunk@53143


git-svn-id: http://core.svn.wordpress.org/trunk@52732 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 19:10:13 +00:00
gziolo 44a0e46c85 Editor: Update `build_comment_query_vars_from_block` from Gutenberg
Follow-up for [53138].
See #55505.


Built from https://develop.svn.wordpress.org/trunk@53142


git-svn-id: http://core.svn.wordpress.org/trunk@52731 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 16:35:10 +00:00
gziolo 4a76af7233 Build: Bring `caniuse-lite` to the latest version
This ensures that build tools target the most recent version of browsers supported by WordPress.

Follow-up [53135].
See #51750, #55505.


Built from https://develop.svn.wordpress.org/trunk@53141


git-svn-id: http://core.svn.wordpress.org/trunk@52730 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 16:25:11 +00:00
gziolo 29254bd90a Build: Enable React Fast Refresh for block development
Brings the same functionality introduced in the Gutenberg plugin with https://github.com/WordPress/gutenberg/pull/28273. In effect, it brings React Fast Refresh support to WordPress core for block development with `@wordpress/scripts`.

Props walbo, antonvlasenko.
See #51750, #55505.
Follow-up [53135].


Built from https://develop.svn.wordpress.org/trunk@53140


git-svn-id: http://core.svn.wordpress.org/trunk@52729 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 16:10:22 +00:00
gziolo 8b207b7967 REST API: Fix the wrong name in the comments controller
It should be `embeddable` not `embedded`.
Follow-up [53138].

Props timothyblynjacobs.
See #55505.



Built from https://develop.svn.wordpress.org/trunk@53139


git-svn-id: http://core.svn.wordpress.org/trunk@52728 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 15:37:09 +00:00
gziolo f3fc52f959 Editor: Add changes for new Comments Query Loop blocks
Backports changes from Gutenberg to add functions required by Comment Query Loop and related blocks. Related unit tests depends on the new blocks and they will get added seperately.

Props darerodz, timothyblynjacobs.
See #55505.


Built from https://develop.svn.wordpress.org/trunk@53138


git-svn-id: http://core.svn.wordpress.org/trunk@52727 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 15:22:09 +00:00
Sergey Biryukov 3180ab2cef Code Modernization: Rename parameters that use reserved keywords in `wp-admin/includes/class-wp-site-icon.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 `$object` variable to `$attachment` in `WP_Site_Icon::insert_attachment()` and updates the documentation accordingly.

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53137


git-svn-id: http://core.svn.wordpress.org/trunk@52726 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 14:21:09 +00:00
audrasjb 8f35c61e7b Administration: Replace "can not" with "cannot" after [53131].
Follow-up to [53132], [53131], [52979].

Built from https://develop.svn.wordpress.org/trunk@53136


git-svn-id: http://core.svn.wordpress.org/trunk@52725 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 12:08:09 +00:00
gziolo 2ec4c366e6 Build: Update webpack to v5.x
Update webpack version to latest version https://www.npmjs.com/package/webpack. This aligns closer with how the Gutenberg plugin handles WordPress packages. Related update in Gutenberg from August 2021: https://github.com/WordPress/gutenberg/pull/33818.

Props walbo, desrosj, mukesh27.
Fixes #51750.



Built from https://develop.svn.wordpress.org/trunk@53135


git-svn-id: http://core.svn.wordpress.org/trunk@52724 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 12:04:30 +00:00
audrasjb 4557cd683b Administration: Revert unwanted spaces found in `theme.json` after [53131].
Follow-up to [53131].

Built from https://develop.svn.wordpress.org/trunk@53134


git-svn-id: http://core.svn.wordpress.org/trunk@52723 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 11:55:00 +00:00
audrasjb 44d52e04a1 Administration: Revert accidental changes made to `theme.json` in changeset [53131].
Follow-up to [53131].

Built from https://develop.svn.wordpress.org/trunk@53133


git-svn-id: http://core.svn.wordpress.org/trunk@52722 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 11:53:00 +00:00
audrasjb e0bb68d7cb Administration: Replace "can not" with "cannot" after [53131].
Follow-up to [53131], [52979].

See #46057, #38913

Built from https://develop.svn.wordpress.org/trunk@53132


git-svn-id: http://core.svn.wordpress.org/trunk@52721 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 11:50:01 +00:00
audrasjb 12fc2d9146 Administration: Remove self-reference ("we") in WordPress Admin.
This changes updates many strings to remove self-references to an undefined "we" collective across the WordPress Administration.

The goal of this change is to better match the guidelines and recommendations set forth in the make/core handbook, specifically:

> the word "we" should be avoided (…) unless its made very clear which group is speaking.

Props johnbillion, shital-patel, audrasjb, marybaum, SergeyBiryukov, peterwilsoncc, johnjamesjacoby, kebbet, costdev, chaion07, davidbaumwald.
Fixes #46057.

Built from https://develop.svn.wordpress.org/trunk@53131


git-svn-id: http://core.svn.wordpress.org/trunk@52720 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 11:42:04 +00:00
gziolo c6ad5a6945 Editor: Add missing `defaultDutone` changes
Follow-up for [53129].

This PR backports the remaining `defaultDuotone` option changes added in the Gutenberg plugin. Related PRs: https://github.com/WordPress/gutenberg/pull/38681 and https://github.com/WordPress/gutenberg/pull/39966.

Props oandregal, ajlende.
See #55505.
 


Built from https://develop.svn.wordpress.org/trunk@53130


git-svn-id: http://core.svn.wordpress.org/trunk@52719 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 11:01:00 +00:00
gziolo 9e3c5a4215 Editor: Add functionality required for theme export in the site editor
This bring across changes to theme export functionality, and related code, and tests. Relates issue in Gutenberg: https://github.com/WordPress/gutenberg/issues/39889.

Props scruffian, timothyblynjacobs, oandregal, ajlende, zieleadam.
See #55505.


Built from https://develop.svn.wordpress.org/trunk@53129


git-svn-id: http://core.svn.wordpress.org/trunk@52718 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 10:38:00 +00:00
gziolo 5d78798b5c Tests: Improve code comments for block supports tests
Follow-up for [53085].

Props ramonopoly, antonvlasenko, peterwilsoncc.
See #55505.


Built from https://develop.svn.wordpress.org/trunk@53128


git-svn-id: http://core.svn.wordpress.org/trunk@52717 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 10:14:04 +00:00
Peter Wilson f27ba31069 Permalinks: Improve settings page error messages.
Props sabernhardt.
Fixes #53141.


Built from https://develop.svn.wordpress.org/trunk@53127


git-svn-id: http://core.svn.wordpress.org/trunk@52716 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 05:16:00 +00:00
Peter Wilson a009192299 Posts, Post Types/Taxonomies: Add object type specific registration filters.
Add post type and taxonomy specific registration argument hooks. 

Introduces the filters `register_{$post_type}_post_type_args` and `register_{$taxonomy}_taxonomy_args`. Introduces the actions `registered_post_type_{$post_type}` and `registered_taxonomy_{$taxonomy}`.

Props pbiron, dlh, davidbaumwald, hellofromTonya, milana_cap.
Fixes #53212.


Built from https://develop.svn.wordpress.org/trunk@53126


git-svn-id: http://core.svn.wordpress.org/trunk@52715 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 05:11:02 +00:00
Peter Wilson b90d225de1 Feeds: Remove comment feed HTML headers when empty.
Remove the `link[rel=alternate]` element from the HTML header when the comment feeds are disabled. Previously the HTML element was output with an empty `href` attribute.

The element is removed if `get_post_comments_feed_link()` returns an empty string or the feed is disabled via the `feed_links_show_comments_feed` filter.

Props barryceelen, audrasjb, costdev, rachelbaker, Boniu91.
Fixes #54703.


Built from https://develop.svn.wordpress.org/trunk@53125


git-svn-id: http://core.svn.wordpress.org/trunk@52714 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 05:03:03 +00:00
Peter Wilson cf4f9c9e61 Plugins: Update item count when plugin deleted.
Update the item count, "N items", on the plugin list when a plugin is deleted. This matches the live updating of various other counts on the screen.

Props mitogh, costdev, azouamauriac, swissspidy, kebbet.
Fixes #55316.


Built from https://develop.svn.wordpress.org/trunk@53124


git-svn-id: http://core.svn.wordpress.org/trunk@52713 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 04:51:11 +00:00
Peter Wilson ce1dd08c07 Administration: Remove term page check from `ajax-response.js`.
Replace hard coded check for the term creation page in `_enqueues/lib/ajax-response.js` with a check for a notification to display in the AJAX response data.

Follow up to  [52170], [52672].

Props SergeyBiryukov, ryokuhi, johnregan3, sabernhardt, joedolson.
Fixes #55078.
See #54955.

Built from https://develop.svn.wordpress.org/trunk@53123


git-svn-id: http://core.svn.wordpress.org/trunk@52712 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 04:37:00 +00:00
Peter Wilson bdd42a3e74 Upgrade/Install/Users: Prevent JS bug filling new passwords.
A JavaScript race condition was throwing an error and preventing passwords from being set if the zxcvbn library loaded earlier than expected. This could prevent the installation of WordPress or the creation/updating of user accounts.

Props adi64bit, afragen, agepcom, audrasjb, bedas, brookedot, cbigler, charlyox, costdev, desrosj, drago239, Eric3D, espiat, jadpm, jrf, justinahinon, kubiq, lkraav, michelangelovandam, mirkolofio, mkox, peterwilsoncc, poena, sbossarte, sebastienserre, SergeyBiryukov, Synchro, thomasplevy, walbo, waterfire, wpmakenorg.
Fixes #53974, #52086.

Built from https://develop.svn.wordpress.org/trunk@53122


git-svn-id: http://core.svn.wordpress.org/trunk@52711 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 04:29:04 +00:00
audrasjb 5c07bc0b59 Twenty Twenty One: Prevent loading translation file twice.
This changes wraps the registration of patterns and pattern categories in a function hooked to `init`, to avoid loading the Twenty Twenty One translation file twice.

Props zodiac1978, sabernhardt, audrasjb.
Fixes #53589.

Built from https://develop.svn.wordpress.org/trunk@53121


git-svn-id: http://core.svn.wordpress.org/trunk@52710 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-10 22:29:03 +00:00
audrasjb 439bf1296f Twenty Twenty: Improve padding for `number` input type.
This changes improves lateral padding for `number` input types in Twenty Twenty bundled theme.

Props helgatheviking, sabernhardt, chaion07, poena, justinahinon, ugyensupport, nayana123.
Fixes #53115.

Built from https://develop.svn.wordpress.org/trunk@53120


git-svn-id: http://core.svn.wordpress.org/trunk@52709 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-10 20:36:02 +00:00
audrasjb 387ce8d003 Administration: Improved padding for pagination setting fields.
This changes improves paddings for the "Number of items per page" field available on list screens.

Props ankit-k-gupta, aezazshekh, mukesh27, sabernhardt, mehedi890.
Fixes #54219.

Built from https://develop.svn.wordpress.org/trunk@53119


git-svn-id: http://core.svn.wordpress.org/trunk@52708 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-10 20:07:59 +00:00
audrasjb f680e20156 General: add missing `strong` tag to some error messages.
Props NekoJonez, oakesjosh.
Fixes #54437.

Built from https://develop.svn.wordpress.org/trunk@53118


git-svn-id: http://core.svn.wordpress.org/trunk@52707 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-10 19:47:02 +00:00
Sergey Biryukov 0c12438eed Code Modernization: Rename parameters that use reserved keywords in `wp-admin/includes/class-wp-site-health.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 `$class` parameter to `$class_name` in `WP_Site_Health::test_php_extension_availability()`.
* Renames some other parameters for consistency.

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53117


git-svn-id: http://core.svn.wordpress.org/trunk@52706 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-10 14:29:04 +00:00
Sergey Biryukov 483a0e38e8 Code Modernization: Rename parameters that use reserved keywords in `wp-admin/includes/class-wp-posts-list-table.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 `$class` parameter to `$css_class` in `WP_Posts_List_Table::get_edit_link()`.
* Renames the `$parent` parameter to `$parent_page` in `WP_Posts_List_Table::_page_rows()`.

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53116


git-svn-id: http://core.svn.wordpress.org/trunk@52705 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-09 20:38:04 +00:00
joedolson 1d65842848 Media: Align username and post title in Save postbox.
Remove the float alignment that places the "Uploaded by" username and the "Uploaded to" post title on the opposite side of the Save postbox for mobile. This matches the alignment on desktop, and makes it easier for low-vision users to track the information relationship between label and content.

Props sabernhardt.
Fixes #55508.
Built from https://develop.svn.wordpress.org/trunk@53115


git-svn-id: http://core.svn.wordpress.org/trunk@52704 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-08 21:10:02 +00:00
joedolson dedfc82ed8 Posts, Post Types: Make permalink fully visible on mobile.
Set `break-word` on sample permalink so the full permalink will be visible on mobile devices in posts, media, and comments. Prevent hidden text overflow or horizontal scrolling on mobile.

Props sumitsingh, sabernhardt.
Fixes #54811.
Built from https://develop.svn.wordpress.org/trunk@53114


git-svn-id: http://core.svn.wordpress.org/trunk@52703 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-08 20:38:00 +00:00
desrosj f27c6a5565 Build/Test Tools: Update some NPM dependencies to the latest versions.
This updates several NPM dependencies to the latest versions, including:

- `check-node-version` from `4.1.0` to `4.2.1`.
- `dotenv` from `10.0.0` to `16.0.0`.
- `dotenv-expand` from `5.1.0` to `8.0.3`.
- `grunt-contrib-concat` from `2.0.0` to `2.1.0`.
- `grunt-contrib-jshint` from `3.1.1` to `3.2.0`.
- `grunt-contrib-uglify` from `5.0.1` to `5.1.0`.
- `qunit` from `2.17.2` to `2.18.1`.
- `sass` from `1.43.4` to `1.50.0`.
- `sinon` from `12.0.1` to `13.0.1`.
- `sinon-test` from `3.1.1` to `3.1.3`.
- `uglify-js` from `3.14.3` to `3.15.3`.
- `wait-on` from `6.0.0` to `6.0.1`.

The updates to `dotenv` and `dotenv-expand` required a minor change to files using these packages.

Additionally, this contains several updates to the `package-lock.json` file as a result of running `npm audit fix`.

See #54727.
Built from https://develop.svn.wordpress.org/trunk@53113


git-svn-id: http://core.svn.wordpress.org/trunk@52702 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-08 20:07:18 +00:00