Ensure the database port number is recorded as an integer or `null` (the default port) when parsing the database host.
This is to prevent PHP/MySQLi throwing an exception caused by ports represented as numeric strings.
Props audrasjb, azouamauriac, chaion07, costdev, johnjamesjacoby, jrf, sergeybiryukov.
Fixes#54877.
Built from https://develop.svn.wordpress.org/trunk@53670
git-svn-id: http://core.svn.wordpress.org/trunk@53229 1a063a9b-81f0-0310-95a4-ce76da25c4cd
No longer delete the default term option in `unregister_taxonomy()` to improve database performance.
Since taxonomies are registered at runtime and can't be unregistered unless they're already registered, prior to this
change the option was created and deleted on each request.
Deleting the option should occur on a one-time opperation such as plugin deactivation.
Follow up to [48480].
Props dlh.
Fixes#54472.
Built from https://develop.svn.wordpress.org/trunk@53669
git-svn-id: http://core.svn.wordpress.org/trunk@53228 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Patterns on the [https://wordpress.org/patterns/ Pattern Directory] can have keywords for better discoverability while searching. The way these are stored [69548ff1f0 was changed from a taxonomy to meta value], but the `/wp/v2/pattern-directory/patterns` endpoint was still pulling from that old value.
The correct property to use for this field is `meta.wpop_keywords`, which returns a single string with comma-separated keywords.
Props ryelle, TimothyBlynJacobs.
See #56126.
Built from https://develop.svn.wordpress.org/trunk@53665
git-svn-id: http://core.svn.wordpress.org/trunk@53224 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The intention was for the preview ratio to remain accurate for the user's screen size when the sidebar is open, but this appears to have caused unintended side effects to the preview alignment.
Follow-up to [52647].
Props superbthemescom, Presskopp.
Fixes#56097. See #54764.
Built from https://develop.svn.wordpress.org/trunk@53663
git-svn-id: http://core.svn.wordpress.org/trunk@53222 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This brings a new version of the Gutenberg code from the [https://github.com/WordPress/gutenberg/tree/wp/6.0 wp/6.0 branch] into core.
Original PR from Gutenberg repository:
* #GB42131 Post Comments Form: Fix warning i18n
The following packages were updated:
* `@wordpress/block-directory` to `3.4.13`
* `@wordpress/block-library` to `7.3.13`
* `@wordpress/customize-widgets` to `3.3.13`
* `@wordpress/edit-post` to `6.3.13`
* `@wordpress/edit-site` to `4.3.13`
* `@wordpress/edit-widgets` to `4.3.13`
Props zieladam, bernhard-reiter, tobifjellner.
See #56058.
Built from https://develop.svn.wordpress.org/trunk@53657
git-svn-id: http://core.svn.wordpress.org/trunk@53216 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When querying 'fields' equal to 'all' using the `WP_User_Query` class, this returns an array of `WP_User` objects. A `WP_User` object requires user meta to be primed, as the user's role is stored in user meta. Ensure that all users meta is primed in a single request by calling the `cache_users` function when querying 'fields' equal to 'all'. Soft deprecate fields equal to `all_with_meta` as it now acts the same as 'fields' equal to 'all'.
Props Spacedmonkey, peterwilsoncc, mehulkaklotar, timothyblynjacobs, furi3r.
Fixes#55594.
Built from https://develop.svn.wordpress.org/trunk@53655
git-svn-id: http://core.svn.wordpress.org/trunk@53214 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This should make cron spawning faster on LSAPI by ensuring that cron requests return immediately.
To avoid code repetition, the no caching headers are relocated and always sent. Caching plugins attempting to set these
headers later will replace those set by WordPress Core.
Follow up to [44488].
Props maximej, johnbillion.
Fixes#54668.
Built from https://develop.svn.wordpress.org/trunk@53653
git-svn-id: http://core.svn.wordpress.org/trunk@53212 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Meetup.com was previously removed as an oEmbed source, since they have deprecated their endpoint. The block has also been removed from the editor, see #GB35085.
This commit updates the associated changelog entry for the `oembed_providers` filter to version 6.0.1, as the change is being backported to the 6.0 branch.
Follow-up to [53540].
See #55997.
Built from https://develop.svn.wordpress.org/trunk@53646
git-svn-id: http://core.svn.wordpress.org/trunk@53205 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This brings a new version of the Gutenberg code from the [https://github.com/WordPress/gutenberg/tree/wp/6.0 wp/6.0 branch] into core.
The following packages were updated:
* `@wordpress/block-directory` to `3.4.12`
* `@wordpress/block-editor` to `8.5.9`
* `@wordpress/block-library` to `7.3.12`
* `@wordpress/components` to `19.8.5`
* `@wordpress/customize-widgets` to `3.3.12`
* `@wordpress/edit-post` to `6.3.12`
* `@wordpress/edit-site` to `4.3.12`
* `@wordpress/edit-widgets` to `4.3.12`
* `@wordpress/editor` to `12.5.9`
* `@wordpress/format-library` to `3.4.9`
* `@wordpress/icons` to `8.2.3`
* `@wordpress/interface` to `4.5.6`
* `@wordpress/list-reusable-blocks` to `3.4.5`
* `@wordpress/nux` to `5.4.5`
* `@wordpress/plugins` to `4.4.3`
* `@wordpress/preferences` to `1.2.5`
* `@wordpress/reusable-blocks` to `3.4.9`
* `@wordpress/server-side-render` to `3.4.6`
* `@wordpress/widgets` to `2.4.9`
Props zieladam.
See #56058.
Built from https://develop.svn.wordpress.org/trunk@53644
git-svn-id: http://core.svn.wordpress.org/trunk@53203 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This aims to provide better context and more details if an unexpected `_doing_it_wrong()` message or deprecation notice is encountered during a test run.
Previously, this would display a message like `Unexpected incorrect usage notice for [...]`, but without any further details, making it harder to track down the actual issue.
Follow-up to [25402], [25408], [25785], [37861], [51872].
See #55652.
Built from https://develop.svn.wordpress.org/trunk@53637
git-svn-id: http://core.svn.wordpress.org/trunk@53196 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
[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
`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
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
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
* 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
`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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
* 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
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
* 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
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
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
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
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
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
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
* 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
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
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
* 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
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
* 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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
`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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
[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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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