46849 Commits

Author SHA1 Message Date
Jb Audras
1e42035895 Twenty Seventeen: Improve letter-spacing reset for non-latin alphabets.
This changeset resets `letter-spacing` for Persian and Urdu, and changes the related CSS selector to include any Persian locale.

Props amirrezatm, itpathsolutions, sabernhardt, mukesh27.
Fixes #56994.


git-svn-id: https://develop.svn.wordpress.org/trunk@54838 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-14 21:30:23 +00:00
Jonathan Desrosiers
caba697a0e Upgrade/Install: Delete the comments-query-loop folder in wp-includes/blocks.
This properly deletes the now empty `src/wp-includes/blocks/comments-query-loop` directory and adds that directory to the `$_old_files` array.

The files in this directory were removed in [54257], but the directory was not marked as deleted in SVN.

Props azaozz, jorbin, SergeyBiryukov.
Fixes #57080.

git-svn-id: https://develop.svn.wordpress.org/trunk@54836 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-14 18:22:41 +00:00
Jb Audras
81fb19c7cf Docs: Typo correction in get_registered_nav_menus() docblock.
Props nithins53.
Fixes #57101.
See #56792.


git-svn-id: https://develop.svn.wordpress.org/trunk@54835 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-14 14:23:00 +00:00
Sergey Biryukov
7e1913c551 Administration: Add missing escaping for a few strings used as HTML attributes.
Follow-up to [47209], [50997], [51006].

Props kowsar89, riccardodicurti, audrasjb, krupalpanchal, SergeyBiryukov.
Fixes #57093.

git-svn-id: https://develop.svn.wordpress.org/trunk@54834 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-14 11:48:18 +00:00
Jb Audras
f404ff34c0 Docs: Various docblock fixes in Multisite administration functions.
See #56792.


git-svn-id: https://develop.svn.wordpress.org/trunk@54833 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-13 23:17:47 +00:00
Jb Audras
efb7e7b563 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@54832 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-13 22:29:39 +00:00
Sergey Biryukov
12a079e69b 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@54831 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-13 13:49:16 +00:00
Sergey Biryukov
55cddb2ac9 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@54829 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-12 14:49:25 +00:00
Jonathan Desrosiers
d90013cdeb Coding Standards: Apply spacing changes after composer format.
Follow up to [54817].
See #57057.

git-svn-id: https://develop.svn.wordpress.org/trunk@54824 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-11 17:49:28 +00:00
Jonathan Desrosiers
49949cea2c 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@54823 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-11 17:46:05 +00:00
Jonathan Desrosiers
368587707d 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@54821 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-11 17:09:11 +00:00
Jonathan Desrosiers
bb6b296647 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@54819 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-11 16:32:51 +00:00
Jonny Harris
5e8c53a031 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@54817 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-11 16:24:47 +00:00
Jonathan Desrosiers
61ddb267ba 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@54815 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-11 15:53:19 +00:00
Sergey Biryukov
9001cce4e0 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@54813 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-11 15:26:59 +00:00
Jonathan Desrosiers
c3cd95732e 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@54811 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-11 12:44:54 +00:00
Sergey Biryukov
4a827498ea 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@54810 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-11 12:37:10 +00:00
Felix Arntz
23a646a25a 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@54804 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-11 01:48:05 +00:00
Peter Wilson
e4832fb198 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@54803 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-11 01:25:30 +00:00
Peter Wilson
51032426b5 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@54802 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-11 00:59:20 +00:00
Peter Wilson
ac84f67ee4 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@54801 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-11 00:04:58 +00:00
Felix Arntz
8368eef8e0 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@54799 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-10 22:14:53 +00:00
Dominik Schilling
1ab43acf4b 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@54797 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-10 19:38:20 +00:00
Jb Audras
e180b742ce Docs: Improve globals documentation in unregister_taxonomy() and wp_term_is_shared().
Props upadalavipul, mukesh27.
Fixes #57058. 
See #56792.


git-svn-id: https://develop.svn.wordpress.org/trunk@54794 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-10 17:14:43 +00:00
Sergey Biryukov
302ba4f45f 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@54791 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-10 13:05:57 +00:00
Tonya Mork
551c3d6619 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@54789 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-10 12:20:48 +00:00
Jb Audras
7dc6546df9 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@54788 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-10 12:08:49 +00:00
Jb Audras
27760044b3 Text Changes: Remove capitalization on "site editing".
Follow-up to [54786].

Props ocean90.
See #57026.


git-svn-id: https://develop.svn.wordpress.org/trunk@54787 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-10 11:31:15 +00:00
Jb Audras
2e375d4790 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@54786 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-10 09:38:58 +00:00
Peter Wilson
b9304148f1 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@54785 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-10 02:59:56 +00:00
Peter Wilson
19d5bd0787 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@54782 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-10 00:44:10 +00:00
Sergey Biryukov
3d5454875b Coding Standards: Use consistent spelling for "cacheable" in WP_Query::get_posts().
Follow-up to [53941], [54768].

See #57012.

git-svn-id: https://develop.svn.wordpress.org/trunk@54777 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-09 10:25:54 +00:00
Jb Audras
74fb46b54d 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@54776 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-09 09:49:51 +00:00
Jb Audras
dec912b680 Docs: Replace HTTP links with HTTPS in class-pop3.php docblocks and JS vendor readme file.
Props rajeshraval786, hiren1094.
See #57017, #56792.


git-svn-id: https://develop.svn.wordpress.org/trunk@54775 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-09 09:17:16 +00:00
Peter Wilson
bbf1a34454 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@54774 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-09 04:06:47 +00:00
peterwilsoncc
4edede48eb 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@54771 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-09 00:57:02 +00:00
Peter Wilson
6903cfd822 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@54770 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-09 00:38:14 +00:00
Felix Arntz
b8bf29746a 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@54769 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-09 00:28:33 +00:00
Peter Wilson
fba9680eda Query: Bypass caching for filtered SELECTs.
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.



git-svn-id: https://develop.svn.wordpress.org/trunk@54768 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-09 00:26:41 +00:00
Timothy Jacobs
61f569e81a 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@54766 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-08 17:29:48 +00:00
Sergey Biryukov
057f2e64a5 Docs: Document the usage of $wpdb global in WP_Date_Query methods.
Follow-up to [25139], [29933], [38280], [38768].

Props upadalavipul.
Fixes #57033.

git-svn-id: https://develop.svn.wordpress.org/trunk@54765 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-08 13:27:23 +00:00
Sergey Biryukov
be4f63f00f 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@54762 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-07 20:53:18 +00:00
Jb Audras
41fef2f8c9 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@54761 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-07 20:21:07 +00:00
Sergey Biryukov
ad31a2e424 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@54760 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-07 17:45:29 +00:00
Jb Audras
c6e8353e36 Docs: Replace HTTP links with HTTPS in class-json.php docblocks.
Props haritpanchal.
Fixes #57017.
See #56792.


git-svn-id: https://develop.svn.wordpress.org/trunk@54759 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-07 13:33:11 +00:00
Sergey Biryukov
473dfe51c7 General: Use HTTPS for the b2/cafélog link in readme.html.
Follow-up to [691], [47285].

Props rajanpanchal2028.
Fixes #57018.

git-svn-id: https://develop.svn.wordpress.org/trunk@54758 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-07 13:25:10 +00:00
Sergey Biryukov
711dbb7993 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@54757 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-06 16:19:15 +00:00
Sergey Biryukov
399bc757fc 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@54756 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-06 15:54:34 +00:00
Sergey Biryukov
79492c6204 Docs: Correct DocBlock formatting for wp_sitemaps_enabled filter.
Follow-up to [48072], [48094], [48523].

See #56792.

git-svn-id: https://develop.svn.wordpress.org/trunk@54755 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-06 14:46:14 +00:00
Sergey Biryukov
747bf65f4b 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@54754 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-05 22:01:47 +00:00