Commit Graph

33985 Commits

Author SHA1 Message Date
audrasjb ca35d65075 Networks and Sites: Replace "N/A" with "Not applicable" in `choose_primary_blog()`
This changeset replaces "N/A" with "Not applicable" in the `choose_primary_blog()` function. It also makes the text string translatable.

Props kowsar89, SergeyBiryukov, audrasjb, mukesh27.
Fixes #57040.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54384 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-13 22:31:14 +00:00
Sergey Biryukov 7836738bd9 Docs: Document the usage of globals in some functions.
This affects:
* `the_block_editor_meta_boxes()`
* `wp_generate_block_templates_export_file()`
* `WP_oEmbed_Controller::get_proxy_item()`

Follow-up to [44131], [48135], [51151], [53129].

Props krunal265.
Fixes #57082.
Built from https://develop.svn.wordpress.org/trunk@54831


git-svn-id: http://core.svn.wordpress.org/trunk@54383 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-13 13:51:20 +00:00
Sergey Biryukov 243fdb8da2 Tests: Resolve `WP_Query` test failures on MariaDB due to indeterminate sort order.
[54768] added a few tests to verify that caching within `WP_Query` is bypassed when the `SELECT` clause has been modified via a filter, to avoid cache key collisions and the returning of incomplete or unexpected results.

However, creating several posts with the same date/time fields can result in inconsistent sort ordering between MySQL and MariaDB, as each engine refines the order further using a different index.

This commit aims to stabilize the tests by using `assertEqualSets()` instead of `assertEquals()`, since testing the order is out of their scope. Includes removing `array_unshift()` and `array_reverse()` calls as no longer needed.

This resolves a few test failures on MariaDB along the lines of:
{{{
Tests_Query_FieldsClause::test_should_limit_fields_to_id_and_parent_subset
Posts property for first query is not of expected form.
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
     0 => stdClass Object (
-        'ID' => 36019
+        'ID' => 36015
         'post_parent' => 0
     )
     1 => stdClass Object (
-        'ID' => 36018
+        'ID' => 36016
         'post_parent' => 0
     )
     2 => stdClass Object (...)
     3 => stdClass Object (
-        'ID' => 36016
+        'ID' => 36018
         'post_parent' => 0
     )
     4 => stdClass Object (
-        'ID' => 36015
+        'ID' => 36019
         'post_parent' => 0
     )
 )

/tmp/wp-test-runner/tests/phpunit/tests/query/fieldsClause.php:67
/tmp/wp-test-runner/phpunit-5.7.phar:598
}}}

Follow-up to [54768].

Props peterwilsoncc, SergeyBiryukov.
See #57012.
Built from https://develop.svn.wordpress.org/trunk@54829


git-svn-id: http://core.svn.wordpress.org/trunk@54381 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-12 14:51:15 +00:00
desrosj a2a3187437 Coding Standards: Apply spacing changes after `composer format`.
Follow up to [54817].
See #57057.
Built from https://develop.svn.wordpress.org/trunk@54824


git-svn-id: http://core.svn.wordpress.org/trunk@54376 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-11 17:51:12 +00:00
desrosj face84c028 Editor: Improve how `min`/`max` font sizes are calculated for fluid typography.
- Where no fluid max values are set (e.g., single or custom font size values), the "size" value will act as the maximum value in a `clamp()` function.
- In the absence of any fluid `min`/`max` values, the lower bound rule of `>16px` will be enforced. This applies to custom values from the editor or single-value `theme.json` styles. Font sizes below this will not be clamped.
- In a preset, if a `fluid.min` value has been specified, the lower bound rule of `>16px` won't be enforced on this value. Presets with a fluid object therefore, give precedence to theme author's values.
- In a preset, if there is NOT a `fluid.max` but there is `fluid.min`, use the incoming "size" value as the `max`.
- In a preset, if there is NOT a `fluid.min` but there is a `fluid.max`, use `size * min_size_factor` as the `min`. The lower bound rule of `>16px` is enforced here, because the block editor is computing the `min` value. This is consistent with the way minimum sizes are calculated for single or custom values.


Props ramonopoly, mamaduka, andrewserong, aristath, joen, desrosj.
Fixes #57075.
Built from https://develop.svn.wordpress.org/trunk@54823


git-svn-id: http://core.svn.wordpress.org/trunk@54375 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-11 17:48:12 +00:00
desrosj 39f1141e78 Editor: Correctly style separator blocks when only a `background-color` is defined.
When separator blocks are configured using only a `background-color`, they are shown correctly within the editor but not on the front end.

This changes `WP_Theme_JSON` to detect this scenario and move the `background-color` value to just `color` when both `color` and `border-color` are missing.

Props cbravobernal, flixos90, davidbaumwald, hellofromTonya, desrosj, andrewserong, czapla, glendaviesnz, wildworks.
Fixes #56903.
Built from https://develop.svn.wordpress.org/trunk@54821


git-svn-id: http://core.svn.wordpress.org/trunk@54373 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-11 17:11:10 +00:00
desrosj 3b86eee81b Themes: Revert one instance of `wp_get_theme()` from [54817].
Since this specific call to `wp_get_theme()` is found within `wp-includes/blocks`, this change will need to be made upstream in the Gutenberg repository.

See #57057.
Built from https://develop.svn.wordpress.org/trunk@54819


git-svn-id: http://core.svn.wordpress.org/trunk@54371 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-11 16:34:12 +00:00
spacedmonkey 8ea348f6db Themes: Reduce usage of `wp_get_theme` function.
Calling the `wp_get_theme` function creates a instance of the `WP_Theme` class. This can be a performance issue, if all you need is one property of the class instance. This change replaces the usage of `wp_get_theme()->get_stylesheet()` with `get_stylesheet()` to improve performance.

Props spacedmonkey, flixos90, peterwilsoncc, desrosj.
Fixes #57057.
Built from https://develop.svn.wordpress.org/trunk@54817


git-svn-id: http://core.svn.wordpress.org/trunk@54369 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-11 16:26:12 +00:00
desrosj 4e492ffe61 Filesystem: Return FTP/FTP Sockets `exists()` methods to a previous state.
This partially reverts [53860] and [53862], which refactored the `exists()` method to rely on `ftp_rawlist()` instead of `ftp_nlist()`.

[53860] makes a similar attempt to the ones made in [33648] and [34733] (which were also reverted in [35944]). Being compliant with the specifications while continuing to work without issue for all FTP servers continues seem impossible. These little ghosts are the ones we’re scared of the most.

Props jsh4, afragen, costdev, pkolenbr, SergeyBiryukov, dd32, peterwilsoncc, gamecreature, desrosj.
Fixes #56966.
See #51170, #28013.
Built from https://develop.svn.wordpress.org/trunk@54815


git-svn-id: http://core.svn.wordpress.org/trunk@54367 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-11 15:55:13 +00:00
Sergey Biryukov 43addd9e1e Formatting: Check that both `normalizer_*` functions exist in `remove_accents()`.
This applies to:
* `normalizer_is_normalized()`
* `normalizer_normalize()`

Includes removing the `Normalizer::FORM_C` constant as a parameter, since it is the default value for both functions and does not need to be explicitly passed. This avoids a fatal error if a plugin includes polyfill for any of the functions but the `Normalizer` class has a different namespace, for example when using the Symfony polyfill.

Follow-up to [53754].

Props hellofromTonya, costdev, desrosj, mukesh27, zodiac1978, jchambo, gisgeo, SergeyBiryukov.
Fixes #56980.
Built from https://develop.svn.wordpress.org/trunk@54813


git-svn-id: http://core.svn.wordpress.org/trunk@54365 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-11 15:28:12 +00:00
desrosj b497a707b7 Editor: Update block editor packages to the latest patch releases.
This updates the block editor related npm dependencies to their latest patch versions ahead of WordPress 6.1.1.

For a full list of what’s included in this update, see 432ed388f8...6566f5fe9e.

Props aaronrobertshaw, ntsekouras, bernhard-reiter, ramonopoly, isabel_brison, andrewserong, get_dave, scruffian, andraganescu, talldanwp, mciampini, noisysocks, cbravobernal, bph, tyxla, ellatrix, czapla, mcsf, ironprogrammer, wildworks, peterwilsoncc, mamaduka, mikachan, spacedmonkey, cybr, youknowriad, alexstine, aristath, kevin940726, ndiego, 0mirka00, poena, joen, ryankienstra, desrosj, vtad, nithins53, audrasjb, kacper3355, sabernhardt.
Fixes #57038, #56818, #56955, #56923.
Built from https://develop.svn.wordpress.org/trunk@54811


git-svn-id: http://core.svn.wordpress.org/trunk@54363 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-11 12:46:55 +00:00
Sergey Biryukov eb68614e2e Coding Standards: Declare `$wp_taxonomies` global at the top of `unregister_taxonomy()`.
This brings some consistency with how the global is declared in other taxonomy functions.

Follow-up to [36243], [38747], [54794].

See #57058.
Built from https://develop.svn.wordpress.org/trunk@54810


git-svn-id: http://core.svn.wordpress.org/trunk@54362 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-11 12:39:13 +00:00
Felix Arntz 702344e383 Editor: Improve performance of `WP_Theme_JSON` class by reducing usage of expensive array functions.
In many scenarios array functions are more expensive than using simpler `for` or `foreach` loops.

This changeset results in roughly 4% faster `wp_head` execution time for both block themes and classic themes. While this may seem like a small win, it is a worthwhile enhancement and only one part of several other little performance tweaks which are being worked on to improve performance of `theme.json` parsing further.

Props aristath, desrosj, jrf, spacedmonkey.
Fixes #56974.
See #57067.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54356 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-11 01:50:11 +00:00
Peter Wilson 912ac10f4b I18N: Initialize textdomain registry in `wp_load_translations_early()`.
Initialize `WP_Textdomain_Registry` in `wp_load_translations_early()`. This ensures the global `$wp_textdomain_registry` is set up prior to loading the translations.

Props azurseisme, TimothyBlynJacobs, costdev, ocean90, flixos90, swissspidy.
Fixes #57051.


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


git-svn-id: http://core.svn.wordpress.org/trunk@54355 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-11 01:27:10 +00:00
Peter Wilson 3151be6da7 Media: Prevent decoding attribute corrupting JSON data.
Workaround `wp_img_tag_add_decoding_attr()` potentially breaking JavaScript and JSON data by limiting the addition of the decoding attribute to image tags using unescaped double quoted attributes `src` attributes.

Props rodricus, TimothyBlynJacobs, joelmadigan, mw108, adamsilverstein, flixos90, desrosj, mukesh27.
Fixes #56969.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54354 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-11 01:01:12 +00:00
Peter Wilson 9a2189e880 Menus: Apply `menu-item-has-children` class in sub-menus.
Ensure the `menu-item-has-children` class is added to sub-menu items when `wp_nav_menu()` is called with the `depth` parameter specified to a non-zero value.

Follow up to [54478].

Props davidvongries, fpodhorsky, hellofromTonya, innovext, larsmqller, LeonidasMilossis, mattkeys, mukesh27, nuvoPoint, ocean90, outrankjames, petitphp, SergeyBiryukov, sippis, webmandesign.
Fixes #56946.
See #28620.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54353 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-11 00:06:14 +00:00
Felix Arntz 2a57dd7f86 Editor: Avoid running certain logic around `theme.json` parsing unnecessarily for classic themes.
Here's what it does:
* Do not load and parse `theme-i18n.json` schema if the theme does not have a `theme.json` file.
* Fix the variable caching layer around the theme's `theme.json` parsing so that a parent's theme `theme.json` is cached as well.
* Do not run a `WP_Query` for global styles for a user when the theme does not have a `theme.json`.

In a basic WordPress setup, this changeset improves `wp_head` execution time for classic themes by 10%, and overall response time for both block themes and classic themes by 4%. This may seem like a small win, but 4% reduced overall response time is actually quite a bit for one change, and it is worth mentioning that this is just one of several other little performance tweaks which are being worked on to improve performance of `theme.json` parsing further.

Props flixos90, manuilov, oandregal, peterwilsoncc, spacedmonkey.
Fixes #56945.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54351 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-10 22:16:15 +00:00
Dominik Schilling c9a4d274fc I18N: Always pass `$locale` to `load_textdomain()`.
In [53874] the optional `$locale` parameter was added to `load_textdomain()`. While most `load_textdomain()` calls in core were were updated, some were missed. Passing the original locale avoids the need to call `determine_locale()` by `load_textdomain()` which is used as a fallback.

Props ocean90, swissspidy, desrosj.
See #57060.
Built from https://develop.svn.wordpress.org/trunk@54797


git-svn-id: http://core.svn.wordpress.org/trunk@54349 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-10 19:40:11 +00:00
audrasjb c64cc7959e Docs: Improve globals documentation in `unregister_taxonomy()` and `wp_term_is_shared()`.
Props upadalavipul, mukesh27.
Fixes #57058. 
See #56792.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54346 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-10 17:16:12 +00:00
Sergey Biryukov 81da0c1e18 Tests: Correct the test for `get_blogaddress_by_id()` with a non-existing ID.
Due to auto-increment, when running various test groups or classes separately, in this case running all of the tests under `phpunit/tests/multisite/` by including the `--filter Tests_Multisite` parameter, it is entirely possible for the blog ID 42 to actually exist, making the test's assumption incorrect.

By using `PHP_INT_MAX` instead, we can avoid a collision with a fixture of another test.

Follow-up to [31157].

See #56793.
Built from https://develop.svn.wordpress.org/trunk@54791


git-svn-id: http://core.svn.wordpress.org/trunk@54343 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-10 13:07:12 +00:00
hellofromTonya 7341083c81 Update/Install: Deactivate Gutenberg plugin version older than 14.1.
Resolves a fatal error due to `get_template_hierarchy()` due to incompatible older Gutenberg versions.

[54269] introduced this new function for 6.1. The function was introduced in Gutenberg 13.9.0. However, it was not guarded to protect the plugin from when the function was loaded in Core. Gutenberg 14.1.0 added the `function_exists()` guard to protect the plugin from the fatal error.

Minimum compatible version:
This commit changes the Gutenberg minimum compatible version number to 14.1. For versions older than 14.1, the plugin will deactivate when upgrading Core to 6.1 or newer.

Function rename:
Past commits renamed the upgrade function by changing Core's version number. This commit renames the function to be generic, i.e. `_upgrade_core_deactivate_incompatible_plugins()` and adopts the `@since [reason]` strategy to track historical changes to the function. 

Follow-up to [54269], [52199], [52166], [52165], [51180].

Props namithjawahar, hellofromTonya, azaozz, desrosj, ironprogrammer.
Fixes #56985.
Built from https://develop.svn.wordpress.org/trunk@54789


git-svn-id: http://core.svn.wordpress.org/trunk@54341 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-10 12:22:18 +00:00
audrasjb 748a5d9919 Text Changes: Update `@since` mentions for [54786] changes.
This updates the `@since` mention of `get_theme_feature_list()` as this changeset is going to be backported to 6.1.1.

Follow-up to [54786].

See #57026.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54340 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-10 12:10:11 +00:00
audrasjb ef48ee8739 Text Changes: Remove capitalization on "site editing".
Follow-up to [54786].

Props ocean90.
See #57026.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54339 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-10 11:33:14 +00:00
audrasjb b63b1a86ee Text Changes: Replace "Full site editing" with "Site Editor".
This changeset replaces the various occurrences of "Full site editing" with "Site Editor" as it is the new official name of the feature.

For more background about this change, see https://make.wordpress.org/updates/2022/11/04/site-editor-a-more-user-friendly-name/.

Props audrasjb, peterwilsoncc, poena.
Fixes #57026.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54338 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-10 09:40:16 +00:00
Peter Wilson 486bec9939 Canonical: Protect against error for term not exists queries.
Prevent term `NOT EXISTS` queries causing `redirect_canonical()` to throw a fatal error in PHP 8 and above, or a warning in earlier versions.

This ensures the `tax_query`'s `terms` property both exists and is countable before attempting to count it.

Props codesdnc, SergeyBiryukov, kadamwhite, costdev, miguelaxcar.
Fixes #55955.


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


git-svn-id: http://core.svn.wordpress.org/trunk@54337 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-10 03:01:14 +00:00
Peter Wilson 0f7fcc2863 Posts, Post Types: Revert `get_page_by_title()`'s use of `WP_Query`.
Revert to legacy database query in `get_pages_by_title()`. Due to the lack of `orderby` clause in the previous database query, it is not possible to gain consistent results by converting the function to a `WP_Query` wrapper.

Reverts [54271, 54242, 54234].

Props Bjorn2404, 10upsimon, dilipbheda, mukesh27, spacedmonkey, TimothyBlynJacobs, rjasdfiii, stentibbing, pbiron, pento.
Fixes #57039, #56991.
See #57041.


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


git-svn-id: http://core.svn.wordpress.org/trunk@54334 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-10 00:46:16 +00:00
Sergey Biryukov 735313df84 Coding Standards: Use consistent spelling for "cacheable" in `WP_Query::get_posts()`.
Follow-up to [53941], [54768].

See #57012.
Built from https://develop.svn.wordpress.org/trunk@54777


git-svn-id: http://core.svn.wordpress.org/trunk@54329 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-09 10:27:12 +00:00
audrasjb 2fc04a0316 Docs: Fix `block_editor_rest_api_preload()` parameter type.
This changeset fixes the `$preload_paths` parameter type for `block_editor_rest_api_preload()` and related hooks. This parameter expects an array of strings OR an array where the path is the first element (index 0) of this array.

Props chouby.
Fixes #56810. 
See #56792.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54328 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-09 09:51:14 +00:00
audrasjb 8cea4f733a Docs: Replace HTTP links with HTTPS in `class-pop3.php` docblocks and JS vendor readme file.
Props rajeshraval786, hiren1094.
See #57017, #56792.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54327 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-09 09:19:14 +00:00
Peter Wilson 63f944e831 Themes: Re-order valid link pseudo classes.
Re-order the link pseudo classes to follow the long term LoVe (F)HA rule when set via `theme.json`.

In order that the CSS cascade behaves in a predictable manner, it's recommended that the selectors follow the order `:visited`, `:focus`/`:hover`, `:active`. As order affects the specificity, this ensures the interaction states override the visited states. CSS specificity is really quite beautiful, although complex.

Props mikachan, sabernhardt, davidbaumwald, mukesh27, Mamaduka, desrosj.
Fixes #56928.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54326 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-09 04:08:16 +00:00
Peter Wilson 113838ed78 Query: Prevent ID only queries erroring when starting the loop.
Ensure only full post objects are passed to `update_post_author_caches()` when called within `WP_Query::the_post()`. This prevents an error when starting the Loop for Queries initiated with a subset of fields or IDs only.

Props konyoldeath, dd32, lozula, TimothyBlynJacobs, spacedmonkey, mxbclang, peterwilsoncc.
Fixes #56948.


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


git-svn-id: http://core.svn.wordpress.org/trunk@54323 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-09 00:59:12 +00:00
Peter Wilson 330c35b258 Themes: Improve `WP_Query` call getting global styles.
Change `orderby` clause used within `WP_Theme_JSON_Resolver::get_user_data_from_wp_global_styles` to `date` to match the `WP_Query` documentation for the parameter.

Props miguelaxcar, johnbillion, JeffPaul, spacedmonkey, mxbclang, mukesh27.
Fixes #56900.


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


git-svn-id: http://core.svn.wordpress.org/trunk@54322 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-09 00:40:12 +00:00
Felix Arntz 5f61131cc6 Editor: Improve frontend performance for `get_default_block_editor_settings()`.
The `wp_max_upload_size()` function can be expensive to call, especially for large sites or multisites. For the frontend usage of `get_default_block_editor_settings()` knowing the allowed upload size is typically unnecessary.

This changeset adds a condition so that `wp_max_upload_size()` is only called if the current user can actually `upload_files`. It keeps the data present when it is actually needed while avoiding the execution overhead when it is not needed.

Props janthiel, Clorith, flixos90, spacedmonkey.
Fixes #56815.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54321 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-09 00:30:10 +00:00
Peter Wilson 4c90be7e91 Query: Bypass caching for filtered `SELECT`s.
Bypass caching within `WP_Query` when the `SELECT` clause has been modified via a filter. This prevents both cache key collisions and the returning of incomplete or unexpected results when the `SELECT` clause has been modified by an extender.

Props pypwalters, claytoncollie, johnwatkins0, TimothyBlynJacobs, costdev, spacedmonkey, peterwilsoncc.
Fixes #57012.


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


git-svn-id: http://core.svn.wordpress.org/trunk@54320 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-09 00:28:16 +00:00
TimothyBlynJacobs 72cc029989 Query: Don't attempt caching if running a WP_User_Query before plugins_loaded.
In #55594 user meta caching was enabled by default when making a `WP_User_Query`. Previously, this was only enabled if a developer specifically queried for 'all_with_meta' 
fields. User meta caching is implemented using a pluggable function, `cache_users`. If a plugin runs a `WP_User_Query` before pluggable functions have been defined, this 
will now cause a fatal error.

In this commit, a `function_exists` check is introduced to avoid calling `cache_users` if it's not defined. Additionally, a `_doing_it_wrong` notice is issued if the 
`WP_User_Query::query` method is called before the 'plugins_loaded' hook.

Props carazo, subrataemfluence, oakesjosh, spacedmonkey, obenland, SergeyBiryukov, peterwilsoncc.
Fixes #56952.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54318 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-08 17:31:13 +00:00
Sergey Biryukov 03f4c7972f Docs: Document the usage of `$wpdb` global in `WP_Date_Query` methods.
Follow-up to [25139], [29933], [38280], [38768].

Props upadalavipul.
Fixes #57033.
Built from https://develop.svn.wordpress.org/trunk@54765


git-svn-id: http://core.svn.wordpress.org/trunk@54317 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-08 13:29:16 +00:00
Sergey Biryukov f011bf7f5b Tests: Restore blog switching in `update_posts_count()` test.
The previous iteration of the test passed when run in isolation but failed when running the whole test suite.

Restoring the `switch_to_blog()` call allows the test to pass again pending a deeper investigation.

Follow-up to [54760].

See #57023.
Built from https://develop.svn.wordpress.org/trunk@54762


git-svn-id: http://core.svn.wordpress.org/trunk@54314 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-07 20:55:10 +00:00
audrasjb daccffbd4a Editor: Improve Archive template description.
This changeset improves the description of the Archive template in the Site Editor to make it more accurate.

Follow-up to [52331].

Props Chaton666, webaxones, mukesh27, audrasjb, SergeyBiryukov.
Fixes #57001.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54313 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-07 20:23:11 +00:00
Sergey Biryukov 3481f64d6c Tests: Combine duplicate `update_posts_count()` tests.
This combines the newer test for `update_posts_count()` located in its own file with the pre-existing one from `tests/multisite/site.php`, which was essentially testing the same thing in a similar way.

Includes:
* Renaming the test class per the [https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#naming-and-organization naming conventions].
* Adjusting comments per the documentation standards.
* Updating `@covers` tags for accuracy.
* Removing unnecessary blog switching.
* Using `assertSame()` to check the value type.

Follow-up to [28835], [29667], [52207].

See #57023, #56793.
Built from https://develop.svn.wordpress.org/trunk@54760


git-svn-id: http://core.svn.wordpress.org/trunk@54312 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-07 17:47:11 +00:00
audrasjb b21f66ae06 Docs: Replace HTTP links with HTTPS in `class-json.php` docblocks.
Props haritpanchal.
Fixes #57017.
See #56792.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54311 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-07 13:35:12 +00:00
Sergey Biryukov 8b6b98dc19 General: Use HTTPS for the b2/cafélog link in `readme.html`.
Follow-up to [691], [47285].

Props rajanpanchal2028.
Fixes #57018.
Built from https://develop.svn.wordpress.org/trunk@54758


git-svn-id: http://core.svn.wordpress.org/trunk@54310 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-07 13:27:17 +00:00
Sergey Biryukov 854b4c8a6a Tests: Move `update_blog_status()` tests to their own file.
Reduce some of the clutter in `tests/multisite/site.php` and introduce `tests/multisite/updateBlogStatus.php`. Tests moved over are verbatim at this point.

Follow-up to [1078/tests], [29916], [30784], [30785], [33253].

See #56793.
Built from https://develop.svn.wordpress.org/trunk@54757


git-svn-id: http://core.svn.wordpress.org/trunk@54309 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-06 16:21:11 +00:00
Sergey Biryukov 68bb07cd6f Tests: Remove a custom callback for checking action call count in multisite tests.
Use `MockAction::get_call_count()` instead, for consistency with the rest of the test suite.

Follow-up to [24/tests], [99/tests], [1078/tests], [1089/tests], [29916], [30784], [30785], [33253].

See #56793.
Built from https://develop.svn.wordpress.org/trunk@54756


git-svn-id: http://core.svn.wordpress.org/trunk@54308 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-06 15:56:12 +00:00
Sergey Biryukov 8c7a3bf415 Docs: Correct DocBlock formatting for `wp_sitemaps_enabled` filter.
Follow-up to [48072], [48094], [48523].

See #56792.
Built from https://develop.svn.wordpress.org/trunk@54755


git-svn-id: http://core.svn.wordpress.org/trunk@54307 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-06 14:48:10 +00:00
Sergey Biryukov f0af926dd6 Coding Standards: Correct alignment in various files.
This fixes `Equals sign not aligned with surrounding statements` WPCS warnings, so that the output of `composer format` is clean.

Follow-up to [54445], [54476], [54494], [54522], [54652], [54687].

See #56791.
Built from https://develop.svn.wordpress.org/trunk@54754


git-svn-id: http://core.svn.wordpress.org/trunk@54306 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-05 22:03:16 +00:00
jorgefilipecosta 379096eca1 Fix: Category specific templates always appear as not found.
According to the docs in developer.wordpress.org/reference/classes/wp_term_query/query WP_Term_Query:->query( string|array $query ) returns WP_Term[]|int[]|string[]|string, and we were using an inexistent object property terms making it always empty and look like the taxonomy did not exist.

Props mamaduka, mikachan, ockham, franz00.
See #56902.
Built from https://develop.svn.wordpress.org/trunk@54751


git-svn-id: http://core.svn.wordpress.org/trunk@54303 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-04 18:24:12 +00:00
desrosj 508485887f Build/Test Tools: Fix more `set-output` deprecated warnings.
This updates the `ramsey/composer-install` and `shivammathur/setup-php` actions to their latest versions.

These updates include fixes for the deprecated warnings output when using `set-output` and `save-state` commands.

Props jrf, desrosj.
See #56820, #56882, #56793.
Built from https://develop.svn.wordpress.org/trunk@54750


git-svn-id: http://core.svn.wordpress.org/trunk@54302 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-04 14:40:13 +00:00
Sergey Biryukov feec68f78d Docs: Fix typo in a comment in `wp_prepare_revisions_for_js()`.
Includes updating the comment to use the correct format for multi-line comments as per the documentation standards.

Follow-up to [30353].

Props dilipbheda, mukesh27.
Fixes #56981.
Built from https://develop.svn.wordpress.org/trunk@54749


git-svn-id: http://core.svn.wordpress.org/trunk@54301 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-04 10:10:14 +00:00
Sergey Biryukov a68f2da09a Docs: Document the usage of globals in `upgrade_550()` and `upgrade_560()`.
Follow-up to [47597], [48400], [49572], [49632].

Props upadalavipul.
Fixes #56983.
Built from https://develop.svn.wordpress.org/trunk@54748


git-svn-id: http://core.svn.wordpress.org/trunk@54300 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-03 13:38:17 +00:00
Sergey Biryukov 97468065ef Docs: Add brackets to a function name in `get_page_template()` description.
This ensures the `locate_block_template()` function name is correctly linked in the Developer Reference.

Follow-up to [54179].

See #56792.
Built from https://develop.svn.wordpress.org/trunk@54747


git-svn-id: http://core.svn.wordpress.org/trunk@54299 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-02 19:52:18 +00:00
desrosj cba2405440 Twenty Twenty-One: Properly bump to version 1.7.
The theme version was missed in the relevant stylesheets in [54492].

This updates the last locations to allow 1.7 to be officially released.

See #56450.
Built from https://develop.svn.wordpress.org/trunk@54745


git-svn-id: http://core.svn.wordpress.org/trunk@54297 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-02 03:12:13 +00:00
Sergey Biryukov d24f93f1dc Docs: Update comments in `wp_nav_menu()` tests per the documentation standards.
Includes:
* Fixing a few typos.
* Using the correct format for multi-line comments.
* Removing some comments that duplicate the assertion messages without providing any additional context.

Follow-up to [54478].

See #56792.
Built from https://develop.svn.wordpress.org/trunk@54741


git-svn-id: http://core.svn.wordpress.org/trunk@54293 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-01 20:17:15 +00:00
desrosj 8c1b4df9f1 Build/Test Tools: Don’t ZIP theme ZIP files.
When uploading artifacts during GitHub Action workflows, all files uploaded to an artifact name are zipped. When a ZIP file is uploaded, the result is a horrifying state of ZIP-ception.

This changes the workflow to upload all of the needed theme files to the artifact instead of a singular ZIP file created prior to uploading.

This also fixes a bug where ZIP files generated have the desired theme nested within `src/wp-content/themes` instead of just containing the theme files.

Props ndiego, wildworks, desrosj, bgardner, colorful-tones.
Fixes #56898.
Built from https://develop.svn.wordpress.org/trunk@54740


git-svn-id: http://core.svn.wordpress.org/trunk@54292 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-01 19:20:22 +00:00
audrasjb bc8c1984ea Administration: Remove `role="img"` from decorative SVG images.
This changeset removes `role="img"` attribute from two decorative images: despite being hidden to assistive technologies using `aria-hidden="true"`, automated tools still understand them as images and expect alternative texts.

Props viralsampat, sabernhardt, audrasjb, ryokuhi, elifvish.
Fixes #56824.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54291 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-01 11:05:16 +00:00
audrasjb 97d2dac330 Docs: Typo correction in `wp_dropdown_users()` docblock.
Props aleksganev.
See #56792.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54290 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-01 10:42:17 +00:00
hellofromTonya 9c3b7e5e7c Database: Revert [53575].
When using `'%%%s%%'` pattern with `$wpdb->prepare()`, it works on 6.0.3 but does not on 6.1-RC. Why? The inserted value is wrapped in quotes on 6.1-RC5 whereas it is not on <= 6.0.3.

With 6.1 final release tomorrow, more time is needed to further investigate and test. Reverting this changeset to restore the previous behavior.

This commit also adds a dataset for testing the `'%%%s%%'` pattern.

Props SergeyBiryukov, hellofromTonya, bernhard-reiter, desrosj, davidbaumwald, jorbin.

Fixes #56933.
See #52506.
Built from https://develop.svn.wordpress.org/trunk@54733


git-svn-id: http://core.svn.wordpress.org/trunk@54285 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-31 20:40:10 +00:00
davidbaumwald a3c18208a2 Upgrade/Install: Update `$_old_files` for 6.1.
Props davidbaumwald, SergeyBiryukov.
Fixes #56934.
Built from https://develop.svn.wordpress.org/trunk@54730


git-svn-id: http://core.svn.wordpress.org/trunk@54282 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-31 15:18:14 +00:00
ryelle c7778a4962 Help/About: Add link to the 6.1 release video
Link the image and text to the new 6.1 release video on youtube. The video is currently private, but will be made public during the release party.

Props admwgn, critterverse, joen, annezazu, jpantani, laurlittle, cbringmann, kellychoffman, pablohoney, EidolonNight.
See #56357.


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


git-svn-id: http://core.svn.wordpress.org/trunk@54281 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-31 15:03:12 +00:00
Sergey Biryukov b720b5e1f7 Tests: Move some `@covers` tags in the `formatting` group to the class DocBlock.
This aims to bring more consistency, as these test classes typically cover a single function, unless noted otherwise.

Follow-up to [53562], [53571], [54051].

See #56793.
Built from https://develop.svn.wordpress.org/trunk@54728


git-svn-id: http://core.svn.wordpress.org/trunk@54280 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-31 13:55:13 +00:00
Sergey Biryukov 9805a98734 Docs: Update a link to the Custom Elements spec in `unsupported_valid_tag_names()` unit test docblock.
This changeset replaces a link to the outdated W3C specs on Custom Elements with a link to the corresponding WhatWG specification.

Previously committed in [53205], this appears to be accidentally reverted in [53562].

Follow-up to [53204], [53205], [53562].

Props audrasjb.
See #56792.
Built from https://develop.svn.wordpress.org/trunk@54727


git-svn-id: http://core.svn.wordpress.org/trunk@54279 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-31 13:24:10 +00:00
Sergey Biryukov d08e3420a1 Tests: Split the tests from `multisite.php` into individual test classes.
This aims to bring some consistency to the location of multisite function tests, as well as to make the tests more discoverable and easier to expand.

Follow-up to [29916], [32638], [46251], [54717].

See #56793.
Built from https://develop.svn.wordpress.org/trunk@54726


git-svn-id: http://core.svn.wordpress.org/trunk@54278 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-31 12:57:14 +00:00
Sergey Biryukov 3a3cb930d6 Tests: Prevent `wp_update_themes()` from running in `wp_ajax_update_theme()` tests.
In the tests for updating a theme via Ajax, `wp_installing( true )` is called to prevent `wp_update_themes()` from running.

This worked as expected in `test_update_theme()`, however, it was missed in `test_uppercase_theme_slug()`, which was accidentally relying on the `wp_installing()` status not being properly restored in the previous test.

Now that the `wp_installing()` status was corrected in [54723], the latter test started throwing an error on PHP 8.2:
{{{
1) Tests_Ajax_wpAjaxUpdateTheme::test_uppercase_theme_slug
http_build_query(): Passing null to parameter #2 ($numeric_prefix) of type string is deprecated

/var/www/src/wp-includes/Requests/Transport/cURL.php:345
/var/www/src/wp-includes/Requests/Transport/cURL.php:135
/var/www/src/wp-includes/class-requests.php:381
/var/www/src/wp-includes/class-wp-http.php:395
/var/www/src/wp-includes/class-wp-http.php:615
/var/www/src/wp-includes/http.php:179
/var/www/src/wp-includes/update.php:719
/var/www/src/wp-admin/includes/ajax-actions.php:4292
/var/www/src/wp-includes/class-wp-hook.php:308
/var/www/src/wp-includes/class-wp-hook.php:332
/var/www/src/wp-includes/plugin.php:517
/var/www/tests/phpunit/includes/testcase-ajax.php:265
/var/www/tests/phpunit/tests/ajax/wpAjaxUpdateTheme.php:157
}}}

Replicating the `wp_installing()` status changes in this test too resolves the error.

Follow-up to [38168], [38710], [54722], [54723].

See #56793.
Built from https://develop.svn.wordpress.org/trunk@54725


git-svn-id: http://core.svn.wordpress.org/trunk@54277 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-30 03:50:12 +00:00
Sergey Biryukov 172ab851c5 Tests: Temporarily skip WOFF file test on PHP 8.1.
A recent change to how WOFF files are processed in PHP 8.2 RC3 has caused a new test failure.

The tests was previously skipped on PHP 8.2, however, apparently after a `fileinfo` extension update, it started failing on PHP 8.1 too.

This commit adjusts the skipping condition to include PHP 8.1.

Follow-up to [54508], [54509].

See #56817.
Built from https://develop.svn.wordpress.org/trunk@54724


git-svn-id: http://core.svn.wordpress.org/trunk@54276 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-30 03:28:11 +00:00
Sergey Biryukov 9e04245227 Tests: Correctly restore the `wp_installing()` status in Ajax tests.
In the tests for updating a plugin or theme via Ajax, `wp_installing( true )` was called to prevent `wp_update_plugins()` or `wp_update_themes()` from running.

Since the subsequent `wp_installing( false )` call was in the same `try { ... }` block, it could not be executed if an exception was thrown, affecting other tests.

In this case, after rearranging the Ajax tests in [54722], this started affecting the `get_site_option()` calls in the tests for `wp_ajax_wp_compression_test()`.

By moving both `wp_installing()` calls out of the `try`/`catch` block, we can ensure the status is correctly restored.

Follow-up to [734/tests], [37150], [38168], [38710], [54722].

See #56793.
Built from https://develop.svn.wordpress.org/trunk@54723


git-svn-id: http://core.svn.wordpress.org/trunk@54275 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-30 02:54:11 +00:00
Sergey Biryukov 7b71916b53 Tests: Rename classes in `phpunit/tests/ajax/` per the naming conventions.
This updates the test classes to match the names of the functions being tested.

Includes moving the `@covers` tags from individual test methods to the class DocBlocks.

Reference: [https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#naming-and-organization Writing PHP Tests: Naming and Organization].

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

See #56793.
Built from https://develop.svn.wordpress.org/trunk@54722


git-svn-id: http://core.svn.wordpress.org/trunk@54274 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-30 01:07:12 +00:00
Sergey Biryukov fa79a5e83c Coding Standards: Correct alignment in `Tests_Ajax_Autosave::wpSetUpBeforeClass()`.
This fixes an `Equals sign not aligned with surrounding assignments` WPCS warning.

Follow-up to [54720].

See #56793.
Built from https://develop.svn.wordpress.org/trunk@54721


git-svn-id: http://core.svn.wordpress.org/trunk@54273 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-29 17:12:14 +00:00
Sergey Biryukov c2a843c36a Tests: Remove unused `$user_ids` property in `Tests_Ajax_Autosave` class.
This was previously used to delete the users created during `wpSetUpBeforeClass()`, however that now happens automatically in `WP_UnitTestCase_Base::tear_down_after_class()` via `_delete_all_data()`.

Follow-up to [35311], [37404], [38398].

See #56793.
Built from https://develop.svn.wordpress.org/trunk@54720


git-svn-id: http://core.svn.wordpress.org/trunk@54272 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-29 15:59:11 +00:00
Sergey Biryukov 3316e53dc8 Tests: Remove `skipWithMultisite()` and `skipWithoutMultisite()` from `get_user_count()` tests.
As the tests belong to either the `ms-excluded` or the `ms-required` group, the skipping should not be necessary.

While these methods were initially intended to be used in conjunction with the respective group, the PHPUnit configuration files for single site and multisite exclude these groups as appropriate, so calling these methods explicitly is no longer required.

Follow-up to [40520], [40543], [40564], [43005], [46683], [53011].

See #56793.
Built from https://develop.svn.wordpress.org/trunk@54719


git-svn-id: http://core.svn.wordpress.org/trunk@54271 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-29 15:44:10 +00:00
Sergey Biryukov 76eb6c4b4e Tests: Remove `skipWithMultisite()` from an Ajax test for attachments.
This was previously removed in [51870] and appears to be accidentally readded in [53561].

As the test belongs to the `ms-excluded` group, the skipping is unnecessary and does not affect anything in practice.

Follow-up to [46693], [49835], [51870], [53561].

See #56793.
Built from https://develop.svn.wordpress.org/trunk@54718


git-svn-id: http://core.svn.wordpress.org/trunk@54270 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-29 15:15:11 +00:00
Sergey Biryukov 1de5f1ad95 Tests: Split the tests from `category.php` into individual test classes.
This aims to bring some consistency to the location of category function tests, as well as to make the tests more discoverable and easier to expand.

Follow-up to [28438], [28566], [31006], [31025], [37464], [28438], [31299], [36988], [42364], [42367], [42368], [46413], [53684].

See #56793.
Built from https://develop.svn.wordpress.org/trunk@54717


git-svn-id: http://core.svn.wordpress.org/trunk@54269 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-29 14:40:13 +00:00
Sergey Biryukov 81a1638e9a Tests: Move the tests for pluggable function signatures to the `pluggable` directory.
This aims to bring some consistency to the location of pluggable function tests.

Includes:
* Renaming the test class to better reflect the intention of the tests.
* Adding a `@coversNothing` tag to the class DocBlock.

Follow-up to [34126], [53478], [54702].

Props pbearne, SergeyBiryukov.
See #56793, #56782.
Built from https://develop.svn.wordpress.org/trunk@54716


git-svn-id: http://core.svn.wordpress.org/trunk@54268 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-29 13:41:15 +00:00
antpb 1d4fa825b8 Media: Reverts `get_attached_file()` changes for normalized Windows paths.
Based on feedback from network storage configurations there was a noticed slowdown due to the usage of the `path_join()` function. This needs more time to find a workaround.

Follow-up to [53934].
Props mreishus, SergeyBiryukov, desrosj, mikeschroder.
Reverts [53934].
See #56924.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54264 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-28 15:18:11 +00:00
Sergey Biryukov 322445185a Tests: Move `dbDelta()` tests to the `db` directory.
This aims to bring some consistency with other database-related tests.

Includes adding a missing `@covers` tag to the class DocBlock.

Follow-up to [30345], [32108], [32770], [51798].

Props pbearne, SergeyBiryukov.
See #56793, #56782.
Built from https://develop.svn.wordpress.org/trunk@54711


git-svn-id: http://core.svn.wordpress.org/trunk@54263 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-28 14:49:11 +00:00
Sergey Biryukov 42da3b9dd3 Tests: Move the tests for `WP` class methods to the `wp` directory.
This aims to bring some consistency to the location of the tests for this class.

Includes adding the missing `@covers` tags.

Follow-up to [36177], [51622], [54250].

Props pbearne, SergeyBiryukov.
See #56793, #56782.
Built from https://develop.svn.wordpress.org/trunk@54710


git-svn-id: http://core.svn.wordpress.org/trunk@54262 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-28 14:10:15 +00:00
davidbaumwald 44881d209b Themes: Ensure custom global styles are imported properly.
This change removes caching of global styles for logged in users, allowing "wp_global_styles" custom post type to be imported completely, regardless of any previously cached data.  This change now relies on the lower-level native `WP_Query` cache invalidation methods for the global styles post type.

Follow-up to [52275], [54186].

Props anariel-design, bernhard-reiter, andrewserong, spacedmonkey, andraganescu, peterwilsoncc, oandregal, hellofromTonya.
Fixes #56901.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54258 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-27 16:34:12 +00:00
Sergey Biryukov 32ec2dec3d Tests: Rename classes in `phpunit/tests/comment/` per the naming conventions.
https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#naming-and-organization

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

See #56793.
Built from https://develop.svn.wordpress.org/trunk@54704


git-svn-id: http://core.svn.wordpress.org/trunk@54256 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-27 15:55:11 +00:00
davidbaumwald 94ba2c6bf1 Editor: Ensure global styles are rendered for third-party blocks.
This change ensures custom styles for all third-party blocks are rendered on the front end if assets are set to be loaded on a per-block basis.  Additionally, this change includes new unit tests to help prevent a similar bug in the future.

Props scruffian, aristath, poena, wildworks, ajlende, andraganescu, ndiego, gigitux, cbravobernal, ramonopoly, andrewserong, oandregal, hellofromTonya, bernhard-reiter.
Fixes #56915.
Built from https://develop.svn.wordpress.org/trunk@54703


git-svn-id: http://core.svn.wordpress.org/trunk@54255 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-27 15:41:12 +00:00
Sergey Biryukov d60cae82a1 Tests: Move `wp_mail()` tests to the `pluggable` directory.
This aims to bring some consistency with other pluggable function tests.

Includes moving the `@covers` tag from a single test method to the class DocBlock.

Follow-up to [221/tests], [909/tests], [54529].

See #56793.
Built from https://develop.svn.wordpress.org/trunk@54702


git-svn-id: http://core.svn.wordpress.org/trunk@54254 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-27 15:23:12 +00:00
Sergey Biryukov dc8b497eb7 Tests: Move `wp_handle_comment_submission()` tests to the `comment` directory.
This aims to bring some consistency with other comment function tests.

Includes moving the `@covers` tags from individual test methods to the class DocBlock.

Follow-up to [34799], [34801], [53863].

See #56793.
Built from https://develop.svn.wordpress.org/trunk@54701


git-svn-id: http://core.svn.wordpress.org/trunk@54253 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-27 15:03:15 +00:00
desrosj 72ae8d87ac Build/Test Tools: Introduce a workflow for testing and building default themes.
This introduces a GitHub Action workflow that performs the following steps for default themes:

- Test installing npm dependencies and running the build script (for relevant themes).
- Create ZIP files for the .org Theme directory and uploads them as workflow artifacts.

The workflow will only run on limited occasions, one of those being when Twenty Nineteen, Twenty Twenty, or Twenty Twenty-One is edited. These are the themes with build scripts that need to be tested for issues.

It can also be manually run through the GitHub Actions UI for occasions when the ZIP files are needed for a release.

Props peterwilsoncc, desrosj
Fixes #56898.
Built from https://develop.svn.wordpress.org/trunk@54699


git-svn-id: http://core.svn.wordpress.org/trunk@54251 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-26 15:08:13 +00:00
Sergey Biryukov c7f6abe9f4 Docs: Add a `@since` note for `object-fit` support in `safecss_filter_attr()`.
Follow-up to [54675].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54250 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-26 14:22:16 +00:00
Bernhard Reiter 70fd2c8b72 Editor: Update packages for 6.1 Release Candidate 3.
Package updates for bug and regression fixes:

- @wordpress/block-directory: 3.15.10
- @wordpress/block-editor: 10.0.9
- @wordpress/block-library: 7.14.10
- @wordpress/customize-widgets: 3.14.10
- @wordpress/edit-post: 6.14.10
- @wordpress/edit-site: 4.14.12
- @wordpress/edit-widgets: 4.14.10
- @wordpress/editor: 12.16.9
- @wordpress/format-library: 3.15.9
- @wordpress/reusable-blocks: 3.15.9
- @wordpress/widgets: 2.15.9

Original PRs from Gutenberg repository:

* [WordPress/gutenberg#45189 Gutenberg PR 45189] - Fix resizeable editor scrolling
* [WordPress/gutenberg#45234 Gutenberg PR 45234] - Reset background-image property for outline button style
* [WordPress/gutenberg#45161 Gutenberg PR 45161] - Table Block: Add a deprecation for the figcaption element class name
* [WordPress/gutenberg#45159 Gutenberg PR 45159] - File Block: Add a deprecation for the button element class name
* [WordPress/gutenberg#45169 Gutenberg PR 45169] - Video: Add a deprecation for the caption element
* [WordPress/gutenberg#45166 Gutenberg PR 45166] - Embed: Add deprecation for the caption element
* [WordPress/gutenberg#45173 Gutenberg PR 45173] - Gallery: Add a deprecation for captions in the gallery block
* [WordPress/gutenberg#44854 Gutenberg PR 44854] - Embed Block: Add support for Tumblr Dashboard URLs
* [WordPress/gutenberg#45074 Gutenberg PR 45074] - Post editor: Rename view to Preview
* [WordPress/gutenberg#45163 Gutenberg PR 45163] - Featured Image Block: Add missing output escaping
* [WordPress/gutenberg#45118 Gutenberg PR 45118] - [WP6.1] Site editor clips body background style

Follow-up to [54257], [54335], [54383], [54483], [54486], [54490], and [54632].
Props czapla, cbravobernal, ndiego, annezazu, davidbaumwald, desrosj, mikeschroder, hellofromtonya, ocean90.
See #56467.
Built from https://develop.svn.wordpress.org/trunk@54693


git-svn-id: http://core.svn.wordpress.org/trunk@54245 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-25 19:08:45 +00:00
ryelle bd47098589 Help/About: Update About section images.
Switch to the CDN URLs for the images on the About page. Update the images used on Freedoms & Privacy to match the 6.1 design style.

Props richtabor, audrasjb, kebbet.
See #56357.


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


git-svn-id: http://core.svn.wordpress.org/trunk@54242 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-25 14:56:17 +00:00
Sergey Biryukov 27fa0510e6 Administration: Improve the wording of "Site Address" field description.
This aims to clarify that "Site Address (URL)" is a required field that should not be left blank, whether or not the site home page is intended to be different from the WordPress installation directory.

Follow-up to [1203], [3058], [5093], [5141], [13750], [41986].

Props digical, sabernhardt.
Fixes #50629.
Built from https://develop.svn.wordpress.org/trunk@54689


git-svn-id: http://core.svn.wordpress.org/trunk@54241 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-25 14:22:12 +00:00
Bernhard Reiter bbb40de012 Editor: Correctly apply Button block styles for classic themes
In [54358], styling for Button blocks that had been removed from classic themes was reintroduced. However, it was added with a global scope, whereas editor styles are usually added with a `.editor-styles-wrapper` selector, which makes them more specific.

This change modifies the way that classic theme styles are added so that they also get wrapped in an `.editor-styles-wrapper` selector to match specificity.

Furthermore, adjust specificity for some Button block related styling in the editor for the Twenty Twelve and Twenty Twenty themes.

Merges [https://github.com/WordPress/gutenberg/pull/44731 Gutenberg PR 44731] into trunk.

Follow-up to [54358].
Props scruffian, cbravobernal, sabernhardt, audrasjb.
See #56467.
Built from https://develop.svn.wordpress.org/trunk@54687


git-svn-id: http://core.svn.wordpress.org/trunk@54239 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-25 12:19:18 +00:00
desrosj a921157f3a Twenty Twenty-Three: Merge the latest changes from GitHub.
For a full list of changes included, see the `twentytwentythree` repository on GitHub: 0f273d7874...e2005b0272.

Props kafleg, poena, mikachan, tobifjellner, aristath.
See #56383.
Built from https://develop.svn.wordpress.org/trunk@54686


git-svn-id: http://core.svn.wordpress.org/trunk@54238 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-25 01:25:12 +00:00
Peter Wilson ea18ccfdb4 Query: Move cache key generation to its own method.
Introduce `WP_Query::generate_cache_key()` for generating the cache key used by the main database query.

This removes the need for a filter to test that cache keys do not include the WPDB placeholder causing unreachable cache keys. The tests now call `WP_Query::generate_cache_key()` directly.

The filter `wp_query_cache_key` is removed as a hard deprecation. The filter was not included in a stable release.

Follow up to [54634].

Props spacedmonkey, jorbin, azaozz, hellofromtonya, mukesh27, peterwilsoncc, desrosj, audrasjb, adamsilverstein, flixos90, davidbaumwald, joedolson, sergeybiryukov.
Fixes #56802.


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


git-svn-id: http://core.svn.wordpress.org/trunk@54237 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-25 00:37:17 +00:00
desrosj 60cf27f53c Build/Test Tools: Ensure PHPCS related workflows are properly marked as failed.
When a ruleset error is encountered during a PHPCodeSniffer scan, an XML report is not generated and `cs2pr` will exit with a `0`.

In this situation, a workflow run will be marked as passing (even though a failure has occurred) due to the presence of `continue-on-error`.

This adjusts the logic in the Coding Standards and PHP Compatibility workflows to remove the need for the `continue-on-error` option and ensures all failures are accurately reflected within the GitHub Actions UI.

Follow up to [54371].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54230 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-24 16:49:15 +00:00
davidbaumwald a5213e123f Media: Add `object-fit` to the allowed list of CSS properties.
This resolves a bug in Featured Image blocks where `object-fit` was being removed during the `render_callback`.

Props raduiason, pbiron, kebbet, SergeyBiryukov, bernhard-reiter, ironprogrammer, xknown, audrasjb, ckanderson22, ivanjeronimo, seriouslysenpai.
Fixes #56855.
Built from https://develop.svn.wordpress.org/trunk@54675


git-svn-id: http://core.svn.wordpress.org/trunk@54227 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-24 15:36:13 +00:00
desrosj 03a200a9c0 Build/Test Tools: Hardcode the `ref` for the workflow dispatch on failure.
This removes the dynamic aspect of the `createWorkflowDispatch()` call that dispatches a Failed Workflow run when another workflow encounters an issue.

By hardcoding `trunk` as the `ref`, the version of the workflow used will always be the latest, most up to date. This ensures older branches receive the bug fixes and improvements made in `trunk` without having to backport them.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54226 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-24 15:20:14 +00:00
davidbaumwald 0f9b449466 Role/Capability: Revert the newly added `update_role` function for 6.1.
Based on feedback, this enhancement isn't quite ready.  Reverting [54213] for now to continue the work in the next cycle.

Follow-up to [54213].

Props manfcarlo, peterwilsoncc.
Built from https://develop.svn.wordpress.org/trunk@54673


git-svn-id: http://core.svn.wordpress.org/trunk@54225 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-24 14:56:16 +00:00
Sergey Biryukov 89e665383f KSES: Display a notice if any of the required globals are not set.
When using the `CUSTOM_TAGS` constant, these global variables should be set to arrays:

* `$allowedposttags`
* `$allowedtags`
* `$allowedentitynames`
* `$allowedxmlentitynames`

This commit aims to improve developer experience by displaying a more helpful message to explain a PHP fatal error further in the code if any of these globals are either not set or not an array.

Note Using `CUSTOM_TAGS` is not recommended and should be considered deprecated. The `wp_kses_allowed_html` filter is more powerful and supplies context.

Follow-up to [832], [834], [2896], [13358], [21796], [28845], [43016], [48072].

Props doctorlai, pento, KnowingArt_com, bosconiandynamics, TJNowell, ironprogrammer, audrasjb, mukesh27, SergeyBiryukov.
Fixes #47357.
Built from https://develop.svn.wordpress.org/trunk@54672


git-svn-id: http://core.svn.wordpress.org/trunk@54224 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-24 14:49:15 +00:00
Bernhard Reiter ca3cfae579 Blocks: Allow arrays for deprecated asset types in block registration.
In `register_block_type`, continue to allow passing arrays as the `editor_script`, `script`, `view_script`, `editor_style`, and `style` arguments. Note that those fields were soft-deprecated in favor of their `_handles` counterparts in [54155], which would allow specifying multiple items. At the same time, the deprecated fields were limited to `string` or `null`.

However, this broke existing code that passed an array as one of those arguments. For backwards compatibility, this change thus restores the previous behavior. It is implemented in `WP_Block_Type` as a pair of `__get()` and `__set()` methods that wrap around the corresponding `_handles` members, which are arrays of strings.

It also affects the REST API endpoint for block types. The latter’s schema has never allowed for anything other than `string` or `null` for any of those fields. For this reason, it now returns the first element of the array stored in the corresponding `_handles` member in `WP_Block_Type`.

Follow-up [54155].
Props nendeb55, costdev, gziolo, spacedmonkey, mukesh27, sergeybiryukov, audrasjb.
Fixes #56707.
Built from https://develop.svn.wordpress.org/trunk@54670


git-svn-id: http://core.svn.wordpress.org/trunk@54222 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-24 14:16:12 +00:00
Pascal Birchler ba19b8412d I18N: Change how `WP_Textdomain_Registry` stores the default languages path.
`WP_Textdomain_Registry` was introduced in [53874] to store text domains and their language directory paths, addressing issues with just-in-time loading of textdomains when using locale switching and when using`load_*_textdomain()` functions.

Said change has inadvertently caused a performance regression exactly when using`load_*_textdomain()`, which still often is the case, where the cached information was not further used or even overridden.

This change addresses that issue by storing the default languages paths in a separate way, while at the same time making `WP_Textdomain_Registry` easier to maintain and adding new tests to catch future regressions.

Props flixos90, spacedmonkey, ocean90, SergeyBiryukov, costdev.
Fixes #39210.
Built from https://develop.svn.wordpress.org/trunk@54669


git-svn-id: http://core.svn.wordpress.org/trunk@54221 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-24 10:02:16 +00:00
Sergey Biryukov 7240236672 Tests: Make the message for skipping some tests with an external object cache more consistent.
Follow-up to [33702], [34767], [49857], [53821].

See #56793.
Built from https://develop.svn.wordpress.org/trunk@54668


git-svn-id: http://core.svn.wordpress.org/trunk@54220 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-23 12:38:15 +00:00
Sergey Biryukov faba855bfb Tests: Add a test case for `safecss_filter_attr()` with `object-position` property.
Follow-up to [50634].

See #56793.
Built from https://develop.svn.wordpress.org/trunk@54667


git-svn-id: http://core.svn.wordpress.org/trunk@54219 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-22 12:57:15 +00:00
Sergey Biryukov 1a538e7278 Tests: Move `padding-*` test data in KSES tests into its own test case.
This creates separate test cases for `safecss_filter_attr()` with `margin-*` and `padding-*` logical properties for additional clarity.

Follow-up to [54102].

See #56793.
Built from https://develop.svn.wordpress.org/trunk@54666


git-svn-id: http://core.svn.wordpress.org/trunk@54218 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-22 12:26:20 +00:00
audrasjb 1ef93acbe6 Help/About: Typo correction in Dashboard Screen Options.
This changeset fixes a typo in meta boxes preferences. It also changes the related sentence from passive to active voice.

Follow-up to [49179].

Props sabernhardt.
Fixes #56884.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54217 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-22 07:05:16 +00:00
audrasjb 65cdec186b Docs: Align spelling with American English.
This changeset replaces "cancelled" with "canceled" in various docblocks, per the [https://make.wordpress.org/core/handbook/best-practices/spelling/ Spelling Guidelines].

Props costdev.
See #56811, #56792.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54216 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-21 21:51:14 +00:00
audrasjb 823517e1de Docs: Align spelling with American English.
This changeset replaces "behaviour" with "behavior" in various docblocks.

Props kebbet, jrf.
See #56811, #56792.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54215 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-21 21:12:14 +00:00