Commit Graph

20704 Commits

Author SHA1 Message Date
Sergey Biryukov
c7457d772e Site Editor: Show correct theme per template or template part.
Child themes inherit templates and template parts from the parent theme. In Site Editor, the "Added by" column for a template defaults to displaying the child theme, even though it is inherited from the parent, creating confusion as to where the actual templates are located.

This commit ensures that the parent theme is correctly displayed in that scenario.

Follow-up to [51003], [52062].

Props ptahdunbar, WoutPitje, petaryoast, costdev, poena, audrasjb, SergeyBiryukov.
Fixes #55437.
Built from https://develop.svn.wordpress.org/trunk@54860


git-svn-id: http://core.svn.wordpress.org/trunk@54412 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-21 16:50:17 +00:00
Sergey Biryukov
f3b087164d Docs: Fix typo and improve DocBlock formatting in wp-admin/install-helper.php.
Follow-up to [236], [265], [8645], [30542].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54411 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-20 14:10:15 +00:00
Sergey Biryukov
f299e3c83a Coding Standards: Fix WPCS issues in wp-admin/install-helper.php.
This commit adds inline comments instructing PHPCS to ignore some lines for database queries. An explanation is provided with each instruction.

This resolves a few WPCS warnings along the lines of:
{{{
Use placeholders and $wpdb->prepare(); found interpolated variable $table_name at "DESC $table_name"
}}}

Follow-up to [236], [265], [5778].

Props jipmoors, costdev, jrf, SergeyBiryukov.
Fixes #43761.
Built from https://develop.svn.wordpress.org/trunk@54858


git-svn-id: http://core.svn.wordpress.org/trunk@54410 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-19 15:42:16 +00:00
Sergey Biryukov
513a8dc17f Users: Add missing escaping on the Add New User screen.
While the `$type` and `$label` variables are set to values that do not currently require escaping, this may change in the future, so it is preferable to add the escaping as a defensive coding measure.

Follow-up to [16294], [29030].

Props monzuralam, rudlinkon, hztyfoon, peterwilsoncc.
Fixes #57133.
Built from https://develop.svn.wordpress.org/trunk@54857


git-svn-id: http://core.svn.wordpress.org/trunk@54409 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-18 15:21:15 +00:00
desrosj
95828a9077 Build/Test Tools: Improve how Composer dependencies are installed.
To improve how Composer dependencies are installed and managed within GitHub Actions, the `ramsey/composer-install` third-party action is now used consistently throughout all workflows.

Previously, some workflows manually ran `composer` commands while others already used `ramsey/composer-install`.

The `ramsey/composer-install` action manages caching dependencies across workflow runs internally, which is something that was manually handled before this change.

Props jrf, desrosj.
Fixes #53841.
Built from https://develop.svn.wordpress.org/trunk@54856


git-svn-id: http://core.svn.wordpress.org/trunk@54408 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-18 14:52:14 +00:00
Sergey Biryukov
25ea9680ae Docs: Update various DocBlocks and inline comments per the documentation standards.
Includes minor formatting edits for consistency.

Follow-up to [53/tests], [12179], [12946], [35288], [37884], [38810], [38928], [46596], [48131], [52955], [53548], [53813], [53873], [54118], [54316], [54420], [54421], [54803].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54407 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-17 18:15:19 +00:00
Sergey Biryukov
260276583c Docs: Update wp_count_posts and wp_count_attachments filter descriptions.
This aims to match the wording generally used for other filters as per the documentation standards.

Follow-up to [25554], [25578], [25579], [53456].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54406 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-17 17:07:15 +00:00
Sergey Biryukov
cede832fb1 Docs: Fix typo in the WP_Theme_JSON::PRESETS_METADATA constant description.
Follow-up to [53129].

Props kebbet, mukesh27.
See #56792.
Built from https://develop.svn.wordpress.org/trunk@54853


git-svn-id: http://core.svn.wordpress.org/trunk@54405 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-17 16:58:20 +00:00
desrosj
44bd7a8471 Build/Test Tools: Add additional details why MacOS jobs are separate.
This adds additional inline context as to why the MacOS job is separate from the Windows and Ubuntu ones in the Test npm workflow.

While it is preferable to combine all of these to avoid repeated code, there is currently no way to determine the runner’s OS within the `if` workflow key.

MacOS jobs use GitHub Action minutes at by a multiple of 10. Being more strict about when to run these jobs ensures minutes are not unintentionally consumed within private forks and mirrors.

See https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability for more details.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54404 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-16 20:57:13 +00:00
desrosj
a64c2964f1 Build/Test Tools: Various minor GitHub Action improvements.
This applies several types of improvements to GitHub Action workflows:
- Updates to inline documentation to ensure accuracy.
- Removal of repetitive or unnecessary debug logging.
- Reorganization of some steps to have configuration steps towards the beginning of jobs.
- Step name updates for consistency across workflows.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54403 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-16 19:34:14 +00:00
jorgefilipecosta
5a0499a3df Add: Documentation for postTypes pattern property.
This commit documents the postTypes property part of the block pattern registration added in WordPress/gutenberg#41791, and meanwhile backported into core.

Props mcsf, ntsekouras.
Built from https://develop.svn.wordpress.org/trunk@54850


git-svn-id: http://core.svn.wordpress.org/trunk@54402 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-16 16:36:14 +00:00
desrosj
9940af48e3 Upgrade/Install: Remove bundled theme files from $_old_files.
Because themes are updated independently of Core updates, any deleted files from bundled themes should not be included in the `$_old_files` list.

Any file included in this list is deleted on update, which could cause problems for sites with a given theme active if the removed files were required in earlier versions of that theme and that theme is not updated at the same time.

Props desrosj, costdev, SergeyBiryukov.
Fixes #56936.
Built from https://develop.svn.wordpress.org/trunk@54849


git-svn-id: http://core.svn.wordpress.org/trunk@54401 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-16 15:43:10 +00:00
Sergey Biryukov
5e58ab8b2a Docs: Split the "main part" comment in wp-login.php into two lines.
This aims to better match the multi-line comment format of the documentation standards.

Follow-up to [6643], [52945], [53313].

Props sabernhardt, NekoJonez.
Fixes #56843.
Built from https://develop.svn.wordpress.org/trunk@54848


git-svn-id: http://core.svn.wordpress.org/trunk@54400 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-16 13:51:13 +00:00
Sergey Biryukov
42c1f97aaa Docs: Minor DocBlock edits for get_adjacent_post() and related functions.
This aims to better match the line wrapping recommendations of the documentation standards.

Follow-up to [16951], [28111], [32606], [37254].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54394 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-15 00:34:12 +00:00
Sergey Biryukov
8a3426bf8b Docs: Correct type for the $post parameter of the {$adjacent}_post_link filter.
The parameter was documented as `WP_Post`, but it contains the value of `get_adjacent_post()`, which returns an empty string if there is no corresponding post, so the correct type is `WP_Post|string`.

Follow-up to [11243], [16951], [28111], [32606].

Props apermo, audrasjb.
Fixes #57047.
Built from https://develop.svn.wordpress.org/trunk@54841


git-svn-id: http://core.svn.wordpress.org/trunk@54393 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-15 00:19:13 +00:00
audrasjb
9b53ca0fd2 Text Changes: Improve the wording of the email sent to confirm site deletion.
Props NekoJonez, SergeyBiryukov, mukesh27, audrasjb.
See #56921.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54392 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-14 21:57:10 +00:00
audrasjb
7d6e977293 Help/About: Fix inconsistency in auto-updates help tabs.
This changeset ensures the wording of auto-updates related help tabs is consistent with other help tabs.

Props NekoJonez, SergeyBiryukov, mukesh27, audrasjb.
Fixes #56921.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54391 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-14 21:53:11 +00:00
audrasjb
5f2083cb7b 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54390 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-14 21:32:17 +00:00
desrosj
5fc5af9722 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.
Built from https://develop.svn.wordpress.org/trunk@54836


git-svn-id: http://core.svn.wordpress.org/trunk@54388 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-14 18:24:12 +00:00
audrasjb
cf77d178a0 Docs: Typo correction in get_registered_nav_menus() docblock.
Props nithins53.
Fixes #57101.
See #56792.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54387 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-14 14:24:12 +00:00
Sergey Biryukov
948a260e80 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.
Built from https://develop.svn.wordpress.org/trunk@54834


git-svn-id: http://core.svn.wordpress.org/trunk@54386 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-14 11:50:15 +00:00
audrasjb
4e4016f61f Docs: Various docblock fixes in Multisite administration functions.
See #56792.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54385 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-13 23:19:12 +00:00
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 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.


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
ryelle
1f9aedf926 Help/About: Update the About header image.
When used inline, the SVG needs the `aria-hidden`, `focusable`, and `viewBox` properties for accessibility. Additionally, this optimizes the SVG by using `cirlce` elements in place of `path`, and removing `clipPath`. There is no visible change, but the file is now one-third the size.

Props sabernhardt.
See #56703, #56357.


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


git-svn-id: http://core.svn.wordpress.org/trunk@54214 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-21 16:44:16 +00:00
Sergey Biryukov
72469add22 Docs: Document the usage of $wp_query global in WP_Media_List_Table::display_rows().
Follow-up to [34127].

Props upadalavipul, saumil1611.
Fixes #56839.
Built from https://develop.svn.wordpress.org/trunk@54661


git-svn-id: http://core.svn.wordpress.org/trunk@54213 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-21 13:35:21 +00:00
joedolson
9f988fec20 Editor: Fix modal height responsiveness on link popup editor.
Fix the responsive breakpoint styles for short vertical viewports on the link popup modal. Follow up to [54216].

Props sabernhardt.
Fixes #53174.
Built from https://develop.svn.wordpress.org/trunk@54660


git-svn-id: http://core.svn.wordpress.org/trunk@54212 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-20 21:46:15 +00:00
Aaron Jorbin
105b321283 Docs: Add missing default parameter value in themes_api() docblock.
Previously: [54655] [54657]

Props rezakhan995, costdev.
Fixes #56862.
See #56792.


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


git-svn-id: http://core.svn.wordpress.org/trunk@54211 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-20 18:25:12 +00:00
Aaron Jorbin
67cb80cac3 Docs: Add missing default parameter value in trackback_response() docblock.
Previously: [54656] [54657]

Props rakibwordpress, audrasjb, SergeyBiryukov.
Fixes #56867.
See #56792.


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


git-svn-id: http://core.svn.wordpress.org/trunk@54210 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-20 18:23:14 +00:00
Sergey Biryukov
7490127885 Coding Standards: Use strict comparison in wp-admin/update-core.php.
This updates a conditional in `do_core_upgrade()` to use strict comparison for error codes that are static strings.

Follow-up to [8595], [36349].

Props rezakhan995, kebbet, mukesh27, jrf, SergeyBiryukov.
Fixes #56866.
Built from https://develop.svn.wordpress.org/trunk@54654


git-svn-id: http://core.svn.wordpress.org/trunk@54206 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-20 14:30:20 +00:00
Gary Pendergast
12d9878827 Embeds: Broaden the Tumblr oEmbed matcher to include all Tumblr URL structures.
Tumblr's oEmbed API correctly rejects invalid URLs, we can rely on that for the handful of cases that aren't embeddable URLs.

Props cbravobernal, bernhard-reiter.
Fixes #56733.


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


git-svn-id: http://core.svn.wordpress.org/trunk@54204 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-20 00:00:16 +00:00
desrosj
6994dfddd0 Build/Test Tools: Update third-party welcome Action.
This updates the third-party action used to post a welcome message to pull requests opened by first time contributors.

This release updates the action to use Node.js version 16 instead of 12, the latter of which support has been deprecated for in GitHub Action runners.

The action has also changed from `bukboo/welcome-action` to `wow-action/welcome`.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54203 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-19 18:28:12 +00:00
desrosj
a0da955b66 General: Correctly refer to “npm” and “Node.js”.
This update all references to npm and Node.js to their correct spelling.

Fixes #56816.
Built from https://develop.svn.wordpress.org/trunk@54650


git-svn-id: http://core.svn.wordpress.org/trunk@54202 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-19 18:20:11 +00:00
desrosj
4d2e4791f0 Build/Test Tools: Remove use of set-output in Action workflows.
The `save-state` and `set-output` commands have been deprecated in GitHub Actions. This removes all occurrences of the command within workflow steps.

This will not remove all deprecated notices from workflow summaries (some third-party actions still contain instances of these commands and need to be fixed upstream), but it will fix the notices caused by custom workflow code.

See #56820.
Built from https://develop.svn.wordpress.org/trunk@54649


git-svn-id: http://core.svn.wordpress.org/trunk@54201 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-19 18:12:14 +00:00
Sergey Biryukov
730d9d4b49 Editor: Add font size constraints for fluid typography.
This commit:
* Adds default minimum font size limits so that min font size, where provided, does not become smaller than `14px`/`0.875rem`/`0.875em`.
* For font sizes of `< 14px` that have no defined minimum sizes, uses the font size to set the floor of the `clamp()` value.

This bugfix prevents converting existing small font sizes to clamp values that will reduce their font size even further in narrow widths. It therefore improves backward compatibility and accessibility.

Original PR from Gutenberg repository:
* [https://github.com/WordPress/gutenberg/pull/44993 #44993 Fluid typography: add font size constraints]

Follow-up to [54260], [54360], [54497], [54500].

Props ramonopoly, andrewserong, isabel_brison, Joen, bernhard-reiter.
See #56467.
Built from https://develop.svn.wordpress.org/trunk@54646


git-svn-id: http://core.svn.wordpress.org/trunk@54198 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-19 12:27:10 +00:00
Sergey Biryukov
4804e14f92 Help/About: Restore the correct header image for WordPress 6.1.
The new About header image appears to have been accidentally reverted to the older one in a previous commit.

Follow-up to [54635], [54638].

Props kebbet.
See #56703.
Built from https://develop.svn.wordpress.org/trunk@54645


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

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

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

Follow-up to [53578], [54484].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54195 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-18 20:39:18 +00:00
davidbaumwald
8ad53487bf Trunk is now 6.2 alpha.
Built from https://develop.svn.wordpress.org/trunk@54642


git-svn-id: http://core.svn.wordpress.org/trunk@54194 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-18 20:05:16 +00:00
davidbaumwald
62a40d0212 Post WordPress 6.1 RC2 version bump.
Built from https://develop.svn.wordpress.org/trunk@54640


git-svn-id: http://core.svn.wordpress.org/trunk@54192 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-18 19:35:15 +00:00
davidbaumwald
fa98146d0e WordPress 6.1 RC 2.
Built from https://develop.svn.wordpress.org/trunk@54639


git-svn-id: http://core.svn.wordpress.org/trunk@54191 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-18 19:01:15 +00:00
davidbaumwald
edd35e9803 Administration: Update the Dashboard welcome banner for 6.1.
Reviewed by ryelle and davidbaumwald.

Props ryelle, adampickering, mikeschroder, richtabor.
Fixes #56703.
Built from https://develop.svn.wordpress.org/trunk@54638


git-svn-id: http://core.svn.wordpress.org/trunk@54190 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-18 18:35:13 +00:00
davidbaumwald
1664e1a05f Networks and Sites: Revert the use of the metadata API for *_network_options functions.
[54080] refactored the logic in `get_network_option()`, `update_network_option()` and `delete_network_option()` to use the metadata API. However, this change resulted in issues with large multisite installs that utilize memcached having network options > 1MB in size.

This change reverts [54080] and all related follow-up changes.

Reverts [54080], [54081], and [54082].  Partially reverts [54267] and [54402].

Props pavelschoffer, rebasaurus, johnbillion, spacedmonkey, desrosj, rinatkhaziev.
Fixes #56845.
See #37181.
Built from https://develop.svn.wordpress.org/trunk@54637


git-svn-id: http://core.svn.wordpress.org/trunk@54189 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-18 18:16:16 +00:00
Sergey Biryukov
e4fa7aaecd Bootstrap/Load: Correct sending the X-Pingback header in WP::send_headers().
The logic for sending the `X-Pingback` header for single posts that allow pings was recently moved from `WP::handle_404()`​ to a more appropriate place in `WP::send_headers()`.

To check whether pings are open for a particular post, that logic relies on the `$wp_query` global, which is declared in `WP::handle_404()`, but not in `WP::send_headers()`

This commit ensures that `$wp_query` is globalized in `WP::send_headers()` too, so that the check works as expected.

Follow-up to [54250].

Props strategio, sabernhardt, dlh, davidbaumwald, SergeyBiryukov.
Fixes #56840.
Built from https://develop.svn.wordpress.org/trunk@54636


git-svn-id: http://core.svn.wordpress.org/trunk@54188 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-18 16:11:16 +00:00
ryelle
31e2fb30cc Help/About: Update copy & style for About page and subpages.
Add in missing links and fix incorrect copy. Remove the "header & footer patterns" section. Fix the icons in the feature grid. Add images using temporary links for now. Update the header artwork for About, Credits, Freedoms, and Privacy.

See #56357.
Reviewed by audrasjb.
Props courane01, bph, webcommsat, audrasjb, dansoschin, richtabor.


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


git-svn-id: http://core.svn.wordpress.org/trunk@54187 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-18 15:10:12 +00:00
spacedmonkey
ac1c0a7171 Query: Remove placeholder from query cache key.
Remove escape placeholder from query cache key, as placeholders are a based on a unique id on every request. This means that it is impossible for a cache to be reused, making queries that use escape placeholders such as `LIKE` searches, unable to be cached.  

Props dhl, spacedmonkey, peterwilsoncc, desrosj, chaion07, davidbaumwald, mukesh27.
Fixes #56802.
Built from https://develop.svn.wordpress.org/trunk@54634


git-svn-id: http://core.svn.wordpress.org/trunk@54186 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-18 15:08:12 +00:00
davidbaumwald
6743ca5fc4 Editor: Fix legacy group inner block wrappers in constrained layouts.
Reviewed by bernhard-reiter.

Props isabel_brison, noisysocks, andrewserong, poena, bernhard-reiter.
See #56467.
Built from https://develop.svn.wordpress.org/trunk@54633


git-svn-id: http://core.svn.wordpress.org/trunk@54185 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-18 14:47:15 +00:00
Sergey Biryukov
bfbf1bc053 Editor: Update packages for 6.1 Release Candidate 2.
Package updates for bug and regression fixes:
- `@wordpress/block-directory: 3.15.8`
- `@wordpress/block-editor: 10.0.7`
- `@wordpress/block-library: 7.14.8`
- `@wordpress/components: 21.0.6`
- `@wordpress/customize-widgets: 3.14.8`
- `@wordpress/edit-post: 6.14.8`
- `@wordpress/edit-site: 4.14.10`
- `@wordpress/edit-widgets: 4.14.8`
- `@wordpress/editor: 12.16.7`
- `@wordpress/format-library: 3.15.7`
- `@wordpress/interface: 4.16.6`
- `@wordpress/list-reusable-blocks: 3.15.6`
- `@wordpress/nux: 5.15.6`
- `@wordpress/preferences: 2.9.6`
- `@wordpress/reusable-blocks: 3.15.7`
- `@wordpress/server-side-render: 3.15.6`
- `@wordpress/widgets: 2.15.7`

Original PRs from Gutenberg repository:
- [https://github.com/WordPress/gutenberg/pull/45041 #45041 Font Size Picker Hint: Fallback to font size `slug` if `name` is undefined]
- [https://github.com/WordPress/gutenberg/pull/45045 #45045 Add: Missing output escaping on some blocks]
- [https://github.com/WordPress/gutenberg/pull/44999 #44999 Escape comment author URL]
- [https://github.com/WordPress/gutenberg/pull/44972 #44972 Navigator: restore focus only once per location]
- [https://github.com/WordPress/gutenberg/pull/44858 #44858 Spacing Sizes Control: Try improving layout spacing]
- [https://github.com/WordPress/gutenberg/pull/44878 #44878 Fix: Inspector is usable on the top level block even if it is content locked]
- [https://github.com/WordPress/gutenberg/pull/44809 #44809 Fix list outdents on Enter in quote block]
- [https://github.com/WordPress/gutenberg/pull/44864 #44864 List v2: fix selection when creating paragraph from empty list item]
- [https://github.com/WordPress/gutenberg/pull/44853 #44853 Fix overflowing patterns]
- [https://github.com/WordPress/gutenberg/pull/45050 #45050 Fix visibility of nested Group block appender]
- [https://github.com/WordPress/gutenberg/pull/44887 #44887 wp-env: Use case insensitive regex when checking WP version string]

Follow-up to [54257], [54335], [54383], [54483], [54486], [54490].

Props bernhard-reiter, audrasjb.
See #56467.
Built from https://develop.svn.wordpress.org/trunk@54632


git-svn-id: http://core.svn.wordpress.org/trunk@54184 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-18 13:56:02 +00:00
Sergey Biryukov
c0f8faaed1 Tests: Correct the wp_theme_json_data_default filter name in assertion messages.
The `theme_json_default` filter was previously renamed to `wp_theme_json_data_default`.

This commit updates the messages in `WP_Theme_JSON_Resolver` tests to match the new name.

Follow-up to [54501], [54630].

See #56796, #56835.
Built from https://develop.svn.wordpress.org/trunk@54631


git-svn-id: http://core.svn.wordpress.org/trunk@54183 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-18 13:30:22 +00:00
Sergey Biryukov
2249345f01 Tests: Increase test coverage for WP_Theme_JSON_Resolver.
This commit adds a unit test to check that `WP_Theme_JSON_Resolver::get_theme_data()` returns a `WP_Theme_JSON` object, and that an `add_theme_support()` call overrides the settings from `theme.json`.

Follow-up to [54443], [54493].

Props cbravobernal.
Fixes #56835.
Built from https://develop.svn.wordpress.org/trunk@54630


git-svn-id: http://core.svn.wordpress.org/trunk@54182 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-18 13:21:20 +00:00
desrosj
7e598822d0 Twenty Twenty-Three: Sync the latest fixes for RC2.
For a full list of changes included, see the `twentytwentythree` repository on GitHub: 4ea5d832ec...0f273d7874.

Props mikachan, beafialho, kafleg, richtabor, poena, annezazu.
Fixes #56383.
Built from https://develop.svn.wordpress.org/trunk@54629


git-svn-id: http://core.svn.wordpress.org/trunk@54181 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-18 00:37:16 +00:00
audrasjb
69b5015745 Widgets: Escape RSS error messages for display.
Props xknown, timothyblynjacobs, matveb, talldanwp.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54096 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-17 12:41:11 +00:00
audrasjb
4396588167 Query: Validate relation in WP_Date_Query.
Props dd32, johnjamesjacoby, martinkrcho, ehtis, paulkevan, peterwilsoncc.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54085 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-17 11:49:11 +00:00
audrasjb
1b46797366 Mail: Reset PHPMailer properties between use.
Props xknown, martinkrcho, tykoted.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54084 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-17 11:42:11 +00:00
audrasjb
8b2ade73a2 REST API: Lockdown post parameter of the terms endpoint.
Props johnbillion, tykoted, timothyblynjacobs, peterwilsoncc, martinkrcho, ehtis.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54083 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-17 11:38:11 +00:00
audrasjb
566d22260a Comments: Apply kses when editing comments.
Props davidbaumwald, xknown, peterwilsoncc, paulkevan.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54082 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-17 11:31:12 +00:00
audrasjb
aea22e6fdf Customize: Escape blogname option in underscores templates.
Props xknown, martinkrcho.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54081 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-17 11:26:11 +00:00
audrasjb
969ed1aaf9 Pings/trackbacks: Apply KSES to all trackbacks.
Props dd32, xknown, martinkrcho, peterwilsoncc.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54080 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-17 11:22:11 +00:00
audrasjb
b7f48d4cb4 Media: Refactor search by filename within the admin.
Props vortfu, xknown, peterwilsoncc, paulkevan.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54079 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-17 11:19:11 +00:00
audrasjb
45a6b73042 Posts, Post types: Remove emails from post-by-email logs.
Props paulkevan, xknown, martinkrcho, peterwilsoncc.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54078 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-17 11:06:10 +00:00
audrasjb
89804fb0db General: Validate host on "Are you sure?" screen.
Props voldemortensen, xknown, peterwiloncc.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54077 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-17 11:04:12 +00:00
audrasjb
5144b41546 Posts, Post types: Apply KSES to post-by-email content.
Props voldemortensen, johnbillion, paulkevan, peterwilsoncc, xknown, dd32, audrasjb.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54076 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-17 11:02:17 +00:00
Sergey Biryukov
37ce5fa0de Docs: Clarify default values for a few block function parameters.
This applies to:
* `$block_name` in `strip_core_block_namespace()`
* `$allowed_html` in `filter_block_content()`
* `$pagination_type` in `get_comments_pagination_arrow()`

Follow-up to [46896], [48794], [53138], [54181].

Props rakibwordpress, ironprogrammer, sabernhardt, SergeyBiryukov.
Fixes #56596.
Built from https://develop.svn.wordpress.org/trunk@54520


git-svn-id: http://core.svn.wordpress.org/trunk@54075 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-16 15:46:15 +00:00
Sergey Biryukov
f5ce81abfd Tests: Delete leftover image sub-sizes after WP_Customize_Manager tests.
After running `phpunit --filter test_import_theme_starter_content`, the following files were generated and left in place in the version-controlled `DIR_TESTDATA` directory, resulting in a dirty working copy of the project:
{{{
tests/phpunit/data/images/canola-150x150.jpg
tests/phpunit/data/images/canola-300x225.jpg
}}}

In the test, `canola.jpg` is mocked as an **existing attachment**. When the test invokes `WP_Customize_Manager::import_theme_starter_content()`, existing attachments are passed directly to `wp_generate_attachment_metadata()`, which does not make a copy of the file, and `wp_create_image_subsizes()` creates the above referenced files in the original image's location.

By contrast, `waffles.jpg`, also used in the test, is **not** set as an existing attachment, and in  `import_theme_starter_content()` is passed to `media_handle_sideload()`, which makes a **copy** of the file in the `wp-content/uploads/` directory, and then calls `wp_create_image_subsizes()` against the new file. The resulting sub-sizes are generated in that location, and are cleaned up during `tear_down()`.

The test's `tear_down()` uses `remove_added_uploads()`, which only clears items created in `wp-content/uploads/` (i.e. `waffles*.jpg`), but not the files in the `DIR_TESTDATA` directory (`canola-*.jpg`).

This commit addresses the issue by creating a copy of the file in uploads. This better matches the intention of the test, as existing attachments will most likely be located in uploads and not in an arbitrary path like the test data directory.

Follow-up to [39276], [39346], [39411], [40142], [54424], [54425].

Props ironprogrammer, audrasjb, boniu91, dariak, SergeyBiryukov.
Fixes #56807.
Built from https://develop.svn.wordpress.org/trunk@54519


git-svn-id: http://core.svn.wordpress.org/trunk@54074 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-15 01:10:11 +00:00
Sergey Biryukov
169204a8e0 REST API: Simplify the check for an array of arrays in register_rest_route().
The previous implementation of checking whether the `args` parameter is an array of arrays used `array_filter()`, which would always loop the full array, even though we are only interested in finding one (the first) non-array to display a `_doing_it_wrong()` message.

This commit aims to improve readability and performance of this check by using a `foreach` loop instead, leaving it as soon as the first non-array argument is found.

Follow-up to [54339].

Props TobiasBg, audrasjb, costdev, SergeyBiryukov.
Fixes #56804.
Built from https://develop.svn.wordpress.org/trunk@54518


git-svn-id: http://core.svn.wordpress.org/trunk@54073 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-14 15:55:11 +00:00
jorgefilipecosta
1ea37c466d Global Styles: Improve performance of WP_Theme_JSON::get_merged_data method.
In the WordPress 6.1 cycle, WP_Theme_JSON_Resolver::get_merged_data method has become a hot path that is called many times. By improving small things that are repeated multiple times, we get more performance wins.
This commit reduces the number of calls of the low-level WP_Theme_JSON->merge method, with the corresponding performance improvements.

Props oandregal, aristath, mukeshpanchal27.
See #56467.
Built from https://develop.svn.wordpress.org/trunk@54517


git-svn-id: http://core.svn.wordpress.org/trunk@54072 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-14 10:47:14 +00:00
desrosj
11ca0151d4 Build/Test Tools: Update third-party GitHub Actions.
This updates the following third-party actions to their latest versions:

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

The latest versions of these actions fix the warnings that are being triggered after the deprecation of `set-output` and `save-state` on GitHub Actions.

For more information, see https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/.

See #56820.
Built from https://develop.svn.wordpress.org/trunk@54511


git-svn-id: http://core.svn.wordpress.org/trunk@54070 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-13 17:51:12 +00:00
Sergey Biryukov
dda65e5423 Docs: Correct parameter name for deleted_{$meta_type}meta action.
Follow-up to [27698].

Props divyeshgodhani, costdev.
Fixes #56806.
Built from https://develop.svn.wordpress.org/trunk@54510


git-svn-id: http://core.svn.wordpress.org/trunk@54069 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-13 17:24:15 +00:00
desrosj
6797903bed Tests: Revert unintentional change in [54508].
Unprops desrosj.
See #56817.
Built from https://develop.svn.wordpress.org/trunk@54509


git-svn-id: http://core.svn.wordpress.org/trunk@54068 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-13 16:45:13 +00:00
desrosj
45842aa8e3 Tests: Temporarily skip WOFF file test on PHP 8.2.
A recent change to how WOFF files are processed in PHP 8.2 RC3 has caused a new test failure.

This temporarily marks the `test_wp_check_filetype_and_ext_with_filtered_woff()` test skipped until a deeper analysis can be performed.

Props SergeyBiryukov, jrf, desrosj, oandregal.
See #56817.
Built from https://develop.svn.wordpress.org/trunk@54508


git-svn-id: http://core.svn.wordpress.org/trunk@54067 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-13 16:36:13 +00:00
desrosj
c4e4486622 Build/Test Tools: Remove note about some PHP versions being allowed to fail.
This removes the note stating that PHP 8.1 (see [51604]) and 8.2 (see [53922]) are temporarily allowed to fail.

The compatibility issues were resolved and `continue-on-error` was removed in [53922].

See #56009.
Built from https://develop.svn.wordpress.org/trunk@54507


git-svn-id: http://core.svn.wordpress.org/trunk@54066 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-13 14:30:15 +00:00
audrasjb
3596d1a534 Docs: Fix $cache_headers param type in site_status_page_cache_supported_cache_headers.
Follow-up to [54043].

Props skithund.
Fixes #56805.
See #55646.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54065 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-12 13:43:15 +00:00
audrasjb
c488a71e11 Docs: Inline comment typo correction in wp_image_file_matches_image_meta().
Props kebbet.
See #55646, #56792.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54064 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-12 13:23:14 +00:00
Sergey Biryukov
6b06c73cd7 Docs: Fix typo in a @since note for _get_cron_array().
Follow-up to [53791].

Props kebbet.
See #55646, #56792.
Built from https://develop.svn.wordpress.org/trunk@54504


git-svn-id: http://core.svn.wordpress.org/trunk@54063 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-12 11:53:15 +00:00
davidbaumwald
4abd9a1a07 Post WordPress 6.1 RC1 version bump.
Built from https://develop.svn.wordpress.org/trunk@54503


git-svn-id: http://core.svn.wordpress.org/trunk@54062 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-11 20:51:11 +00:00
davidbaumwald
3e234cece7 WordPress 6.1 RC1.
Built from https://develop.svn.wordpress.org/trunk@54502


git-svn-id: http://core.svn.wordpress.org/trunk@54061 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-11 20:35:11 +00:00
hellofromTonya
88cee0d359 Editor: Rename new theme_json_{$context} filters.
The newly introduced filters are renamed to use the `wp_theme_json_data{$context}` structure:

* `theme_json_default` renamed to `wp_theme_json_data_default`
* `theme_json_theme` renamed to `wp_theme_json_data_theme`
* `theme_json_blocks` renamed to `wp_theme_json_data_blocks`
* `theme_json_user` renamed to `wp_theme_json_data_user`

The following new filter gets the `wp_` prefix added:
* `theme_json_get_style_nodes` renamed to `wp_theme_json_get_style_nodes`

Follow-up to [56467], [54183], [54118].

Props kebbet, desrosj, mukesh27, ocean90, sergeybiryukov, davidbaumwald, hellofromTonya.
Fixes #56796.
Built from https://develop.svn.wordpress.org/trunk@54501


git-svn-id: http://core.svn.wordpress.org/trunk@54060 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-11 20:08:12 +00:00
davidbaumwald
3c1fb44650 Editor: Add test data for Fluid Typography.
Follow-up to [54280] and [54497].

Props desrosj, hellofromTonya, SergeyBiryukov.
See #56467.
Built from https://develop.svn.wordpress.org/trunk@54500


git-svn-id: http://core.svn.wordpress.org/trunk@54059 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-11 19:52:11 +00:00
ryelle
4ac6e1f341 Help/About: Update the About page for 6.1.
This is the start of the WordPress 6.1 about page, introducing new content and a first pass of the new style.

Props adampickering, joen, iamarinoh, dansoschin, desrosj, ryelle, cbringmann, annezazu, priethor, laurlittle, eidolonnight, jeffpaul, sabernhardt, ndiego, richtabor, spacedmonkey, marybaum, abhanonstopnewsuk, courane01, tweetythierry, adamsilverstein, flixos90, ironprogrammer.
See #56357.


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


git-svn-id: http://core.svn.wordpress.org/trunk@54058 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-11 18:51:14 +00:00
hellofromTonya
76b784ca9a Editor: Fix PHP notice in WP_Block_Supports when no attributes declared.
A check is added to verify if the block's `'attrs'` key exists before accessing it. If no, it defaults to an empty array.

How was this found?
WP 6.1 removed the attributes from the `core/page-list` block. When this block is being processed by `WP_Block_Supports::apply_block_supports()`, the key `'attrs'` does not exist in `self::$block_to_render`.

This commit includes a tiny micro-optimization by moving this line of code after the existing guard clause. Why? If the guard clause is triggered, the method bails out early, meaning the attributes code is not used. By moving it after the guard clause, it saves a tiny bit of memory and processing if this happens.

Follow-up to [49310], [54399].

Props petitphp, spacedmonkey, hellofromTonya.
Fixes #56799.
Built from https://develop.svn.wordpress.org/trunk@54498


git-svn-id: http://core.svn.wordpress.org/trunk@54057 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-11 18:46:13 +00:00
davidbaumwald
b0a8a8b46e Editor: Merge latest fluid typography bugfixes for 6.1 Release Candidate 1.
Merges the following:
* [https://github.com/WordPress/gutenberg/pull/44761 Gutenberg PR 44761] - Fluid Typography: Fix bug in global styles where fluid `clamp()` rules were not calculated for custom values
* [https://github.com/WordPress/gutenberg/pull/44762 Gutenberg PR 44762] - Fluid Typography: Convert server-side block support values
* [https://github.com/WordPress/gutenberg/pull/44764 Gutenberg PR 44764] - Fluid Typography: Convert font size inline style attributes to fluid values
* [https://github.com/WordPress/gutenberg/pull/44807 Gutenberg PR 44807] - Fluid Typography: Covert font size number values to pixels
* [https://github.com/WordPress/gutenberg/pull/44847 Gutenberg PR 44847] - Fluid Typography: ensure font sizes are strings or integers

Follow-up to [54280].

Props andrewserong, isabel_brison, ramonopoly.
See #56467.
Built from https://develop.svn.wordpress.org/trunk@54497


git-svn-id: http://core.svn.wordpress.org/trunk@54056 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-11 18:44:13 +00:00
Sergey Biryukov
c11ce53dce Query: Avoid PHP notices when get_queried_object() returns null.
`WP_Query` methods assume that `get_queried_object()` would return a non-null value, which is not always the case.

This commit resolves various warnings in `WP_Query` along the lines of:
{{{
Attempt to read property "post_type" on null in wp-includes/class-wp-query.php on line 4338
}}}

Follow-up to [1728], [3639], [8807], [49119].

Props dd32, yellyc, boonebgorges, darkskipper, Howdy_McGee, swissspidy, nacin, mikeschroder, mikejolley, sterlo, datainterlock, utsavmadaan823, kanlukasz, woji29911, hellofromTonya, zikubd, deksar, bwbama, noplanman, nouarah, SergeyBiryukov.
Fixes #29660.
Built from https://develop.svn.wordpress.org/trunk@54496


git-svn-id: http://core.svn.wordpress.org/trunk@54055 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-11 18:15:13 +00:00
Sergey Biryukov
1f002b93fe External Libraries: Further fix jQuery deprecations in WordPress core.
This replaces calls to the deprecated jQuery `.bind()` method with `.on()` in Plupload's `handlers.js`.

Reference: [https://api.jquery.com/bind/ jQuery API Documentation: .bind()]

Follow-up to [18482], [19266], [50001], [50270], [50367], [50383], [50410], [50420], [50429], [50627], [51947], [52429].

Props eclev91, ipajen, sarahricker.
See #51812.
Built from https://develop.svn.wordpress.org/trunk@54495


git-svn-id: http://core.svn.wordpress.org/trunk@54054 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-11 17:37:12 +00:00
davidbaumwald
48ac09448b Editor: Ensure WP_Query and WP_Term_Query results are referenced properly when creating dynamic template names for use in the site editor.
[54445] updated the new dynamic template name functions used by the site editor in 6.1 to use `WP_Query` and `WP_Term_Query` instances in place of `get_posts` and `get_terms` respectively.  However, the latter functions return an array of results whereas `WP_Query` instances store their found results in a class property.  This change updates the code to reference either `$posts_query->posts` or `$terms_query->terms` where necessary.

Follow-up to [54280], [54333], [54370], [54388], and [54445].

Props bernhard-reiter, spacedmonkey, davidbaumwald.
See #56467.
Built from https://develop.svn.wordpress.org/trunk@54494


git-svn-id: http://core.svn.wordpress.org/trunk@54053 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-11 17:30:12 +00:00
hellofromTonya
701b803ffe Editor: Fix performance regression in WP_Theme_JSON_Resolver.
A significant performance regression was added late in WP 6.1 beta cycle when some of the existing caching for `theme.json` processing was removed. The rationale for removing the caching was this code was now used before all the blocks are registered (aka get template data, etc.) and resulted in stale cache that created issues (see [https://github.com/WordPress/gutenberg/issues/44434 Gutenberg Issue 44434] and [https://github.com/WordPress/gutenberg/issues/44619 Gutenberg Issue 44619]). The changes were limited to only reads from the file system. However, it introduced a big impact in performance.

This commit adds caching and checks for blocks with different origins. How? It add caching for the calculated data for core, theme, and user based on the blocks that are registered. If the blocks haven't changed since the last time they were calculated for the origin, the cached data is returned. Otherwise, the data is recalculated and cached.

Essentially, this brings back the previous cache, but refreshing it when the blocks change.

It partially adds unit tests for these changes. Additional tests will be added.

References:
* [https://github.com/WordPress/gutenberg/issues/44772 Performance regression in WP 6.1 for theme.json processing]

Follow-up to [54251], [54399].

Props aristath, oandregal, bernhard-reiter, spacedmonkey, hellofromTonya.
See #56467.
Built from https://develop.svn.wordpress.org/trunk@54493


git-svn-id: http://core.svn.wordpress.org/trunk@54052 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-11 17:17:13 +00:00
desrosj
9bde65e7ba Bundled Themes: Bump version numbers for 6.1.
In coordination with the release of 6.1, a new version of each bundled theme will also be released. This bumps the version of each theme to the following:

- Twenty Ten: 3.7
- Twenty Eleven: 4.2
- Twenty Twelve: 3.8
- Twenty Thirteen: 3.7
- Twenty Fourteen: 3.5
- Twenty Fifteen: 3.3
- Twenty Sixteen: 2.8
- Twenty Seventeen: 3.1
- Twenty Nineteen: 2.4
- Twenty Twenty: 2.1
- Twenty Twenty-One: 1.7
- Twenty Twenty-Two: 1.3

Additionally, this audits all `$version` parameters for `wp_(enqueue|register)_(script|style)` calls, ensuring accurate last edited or theme version values for proper caching and cache busting.

Props robinwpdeveloper, desrosj, mukesh27.
Fixes #56450.
Built from https://develop.svn.wordpress.org/trunk@54492


git-svn-id: http://core.svn.wordpress.org/trunk@54051 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-11 17:05:13 +00:00
hellofromTonya
87a38efddc Editor: Fix version in WP_Theme_JSON_Resolver::get_block_data().
Introduced during the WP 6.1 alpha cycle, this commit fixes the version number from `1` to `2`.

Follow-up to [54162].

Props oandregal.
See #56467.
Built from https://develop.svn.wordpress.org/trunk@54491


git-svn-id: http://core.svn.wordpress.org/trunk@54050 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-11 16:40:14 +00:00
davidbaumwald
2d9b8cd286 Editor: Bump @wordpress packages for 6.1 Release Candidate 1.
Package updates for bug and regression fixes:
@wordpress/block-directory: 3.15.7
@wordpress/block-library: 7.14.7
@wordpress/customize-widgets: 3.14.7
@wordpress/edit-post: 6.14.7
@wordpress/edit-site: 4.14.9
@wordpress/edit-widgets: 4.14.7

Follow-up to  [54257], [54335], [54383], [54483], and [54486].

Props bernhard-reiter.
See #56467.
Built from https://develop.svn.wordpress.org/trunk@54490


git-svn-id: http://core.svn.wordpress.org/trunk@54049 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-11 16:34:34 +00:00
Sergey Biryukov
88ba20042c Comments: Consistently normalize user_ID to user_id in wp_new_comment().
For backward compatibility, the `user_id` parameter of `wp_new_comment()` can be spelled as `user_ID`, and plugins utilizing the `preprocess_comment` filter or the `comment_post` action should be able to receive both variations.

Follow-up to [12267], [12300], [28915], [36038], [53729].

Props peterwilsoncc, SergeyBiryukov.
Fixes #56244.
Built from https://develop.svn.wordpress.org/trunk@54489


git-svn-id: http://core.svn.wordpress.org/trunk@54048 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-11 16:32:13 +00:00
Sergey Biryukov
2fc21e6b79 Comments: Return early from comment_form() if an invalid post ID is passed.
If an invalid post ID is passed to the function, `comments_open()` should return `false`, and no comment form be displayed. This commit restores the previous behavior that was unintentionally changed when standardizing on the `$post` parameter name.

Follow-up to [53715].

Props peterwilsoncc.
Fixes #56243.
Built from https://develop.svn.wordpress.org/trunk@54488


git-svn-id: http://core.svn.wordpress.org/trunk@54047 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-11 15:45:11 +00:00
davidbaumwald
dd2cc423ef Editor: Remove extra line break in build_template_part_block_instance_variations().
This extra break was causing a QUnit failure check validating version controlled file contents.

Follow-up to [54483].

See #56467.
Built from https://develop.svn.wordpress.org/trunk@54487


git-svn-id: http://core.svn.wordpress.org/trunk@54046 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-11 15:41:13 +00:00
davidbaumwald
0b33636e64 Editor: Change gutenberg_get_typography_font_size_value() calls to wp_get_typography_font_size_value().
Merged Gutenberg functions should be prefixed with `wp_`.

Follow-up to [54483].

Props spacedmonkey.
See #56467.
Built from https://develop.svn.wordpress.org/trunk@54486


git-svn-id: http://core.svn.wordpress.org/trunk@54045 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-11 15:38:11 +00:00
audrasjb
2ddc837e83 Editor: Reinstate old persistence system configuration for the block editor usage data.
In [54182], the configuration for the old preference persistence system was removed. This system is still used for block usage data (to show the most frequently used blocks in the inserter). Furthermore some plugins may use this persistence system.

This changeset reinstates the previous persistence system used by the "Most used blocks" feature in the block inserter.

Follow-up to [54182].

Props talldanwp.
Fixes #56778.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54044 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-11 15:30:11 +00:00
Sergey Biryukov
08dd56a8b1 Upgrade/Install: Revert a temporary conditional for testing the Rollbacks feature project.
This will be readded in 6.2-alpha after a 6.1 branch is created.

Follow-up to [53578].

See #56057.
Built from https://develop.svn.wordpress.org/trunk@54484


git-svn-id: http://core.svn.wordpress.org/trunk@54043 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-11 15:28:13 +00:00
davidbaumwald
23d251e0ab Editor: Update packages for 6.1 Release Candidate 1.
Package updates for bug and regression fixes:
@wordpress/block-directory: 3.15.6
@wordpress/block-editor: 10.0.6
@wordpress/block-library: 7.14.6
@wordpress/components: 21.0.5
@wordpress/customize-widgets: 3.14.6
@wordpress/edit-post: 6.14.6
@wordpress/edit-site: 4.14.8
@wordpress/edit-widgets: 4.14.6
@wordpress/editor: 12.16.6
@wordpress/format-library: 3.15.6
@wordpress/interface: 4.16.5
@wordpress/list-reusable-blocks: 3.15.5
@wordpress/nux: 5.15.5
@wordpress/preferences: 2.9.5
@wordpress/reusable-blocks: 3.15.6
@wordpress/server-side-render: 3.15.5
@wordpress/widgets: 2.15.6

References:
* [https://github.com/WordPress/gutenberg/pull/43181 Gutenberg PR 43181] - Merge inner blocks if wrappers are equal
* [https://github.com/WordPress/gutenberg/pull/44098 Gutenberg PR 44098] - Fix content blocks with nested blocks always appear as top level
* [https://github.com/WordPress/gutenberg/pull/44150 Gutenberg PR 44150] - Refresh selection styles
* [https://github.com/WordPress/gutenberg/pull/44415 Gutenberg PR 44415] - Removes `__unstableMaxPages` attribute from Page List and Nav blocks
* [https://github.com/WordPress/gutenberg/pull/44463 Gutenberg PR 44463] - Follow discussion settings in the comments block edit
* [https://github.com/WordPress/gutenberg/pull/44584 Gutenberg PR 44584] - Avoid querying block templates during installation
* [https://github.com/WordPress/gutenberg/pull/44637 Gutenberg PR 44637] - Resizable editor: Fix height setting bug
* [https://github.com/WordPress/gutenberg/pull/44640 Gutenberg PR 44640] - Only include theme.css if the theme declares support for wp-block-styles
* [https://github.com/WordPress/gutenberg/pull/44650 Gutenberg PR 44650] - Fix empty links being created for the author's name comment
* [https://github.com/WordPress/gutenberg/pull/44652 Gutenberg PR 44652] - Block Editor: Fix block search for non-Latin characters
* [https://github.com/WordPress/gutenberg/pull/44660 Gutenberg PR 44660] - Legacy Group inner block wrapper should work with constrained layout
* [https://github.com/WordPress/gutenberg/pull/44676 Gutenberg PR 44676] - Hide list items from content area of content locked blocks
* [https://github.com/WordPress/gutenberg/pull/44718 Gutenberg PR 44718] - Margin visualizer: Apply negative value to margins with `calc()`
* [https://github.com/WordPress/gutenberg/pull/44721 Gutenberg PR 44721] - Remove anchor support from the navigation block
* [https://github.com/WordPress/gutenberg/pull/44731 Gutenberg PR 44731] - Buttons: Add specificity for the editor

Follow-up to [54257], [54335], and [54383].

Props bernhard-reiter, czapla, annezazu, cbravobernal, ndiego, bjorsch, nendeb55.
See #56467.
Built from https://develop.svn.wordpress.org/trunk@54483


git-svn-id: http://core.svn.wordpress.org/trunk@54042 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-11 15:26:55 +00:00
audrasjb
ac36170175 Networks and Sites: Ensure fileupload_maxk is an int to avoid potential fatal errors.
This changeset fixes a potential fatal error, for example when "Max upload file size" setting is set to an empty value. It also adds unit tests for `upload_size_limit_filter`.

Props mjkhajeh, bhrugesh12, SergeyBiryukov, kebbet, audrasjb, felipeelia.
Fixes #55926.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54041 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-11 15:07:10 +00:00
Sergey Biryukov
82d2620d50 Code Modernization: Add AllowDynamicProperties attribute to recently introduced classes.
This commit is a follow-up to [54133] for new classes introduced in WordPress 6.1 since the previous commit.

Dynamic (non-explicitly declared) properties are deprecated as of PHP 8.2 and are expected to become a fatal error in PHP 9.0.

There are a number of ways to mitigate this:
* If it is an accidental typo for a declared property: fix the typo.
* For known properties: declare them on the class.
* For unknown properties: add the magic `__get()`, `__set()`, et al. methods to the class or let the class extend `stdClass` which has highly optimized versions of these magic methods built in.
* For unknown ''use'' of dynamic properties, the `#[AllowDynamicProperties]` attribute can be added to the class. The attribute will automatically be inherited by child classes.

Trac ticket #56034 is open to investigate and handle the third and fourth type of situations, however it has become clear this will need more time and will not be ready in time for WP 6.1.

To reduce “noise” in the meantime, both in the error logs of WP users moving onto PHP 8.2, in the test run logs of WP itself, in test runs of plugins and themes, as well as to prevent duplicate tickets from being opened for the same issue, the `#[AllowDynamicProperties]` attribute has been added to all “parent” classes in WP.

Reference: [https://wiki.php.net/rfc/deprecate_dynamic_properties PHP RFC: Deprecate dynamic properties].

Follow-up to [53922], [54133].

Props jrf.
See #56513, #56034.
Built from https://develop.svn.wordpress.org/trunk@54481


git-svn-id: http://core.svn.wordpress.org/trunk@54040 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-11 15:00:12 +00:00
desrosj
24d7b3df9e Coding Standards: Remove two unnecessary spaces.
Props kebbet.
See #55647.
Built from https://develop.svn.wordpress.org/trunk@54480


git-svn-id: http://core.svn.wordpress.org/trunk@54039 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-11 14:47:11 +00:00
Sergey Biryukov
d989d0b1f7 Tests: Relocate the tests for recommended PHP, MySQL, and MariaDB versions.
This commit moves the tests for recommended versions of dependencies referenced in `readme.html` to a new location for better context. Also updates test class name for clarity, and `@covers` annotations to `@coversNothing`.

Follow-up to [26166], [33946], [35172], [52418], [52424].

Props ironprogrammer, bbobnis, antonvlasenko, azaozz, chaion07, priyomukul.
Fixes #45867.
Built from https://develop.svn.wordpress.org/trunk@54479


git-svn-id: http://core.svn.wordpress.org/trunk@54038 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-11 14:27:11 +00:00
audrasjb
c3645d036d Menus: Remove .menu-item-has-children on wp_nav_menu last level menu items when $depth arg is used.
This changeset prevents `wp_nav_menu` last level menu items from having the `.menu-item-has-children` class when the `$depth` argument is used. It adds a loop in `wp_nav_menu()` to calculate the depth of each menu item with children to make sure the class is added only when applicable.

Props slobodanmanic, kucrut, iCaspar, mdgl, petitphp, audrasjb, costdev.
Fixes #28620.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54037 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-11 14:04:13 +00:00
Sergey Biryukov
13cca70167 Users: Fetch user by login in retrieve_password() if not found by email.
This ensures that sending a password reset link works as expected if the user's login and email were initially the same, but the email address was subsequently updated and no longer matches the login, which is still set to the old address.

Follow-up to [6643], [18513], [19056], [37474], [50129], [50140].

Props donmhico, pbearne, azouamauriac, boblindner, daxelrod, audrasjb, SergeyBiryukov.
Fixes #53634.
Built from https://develop.svn.wordpress.org/trunk@54477


git-svn-id: http://core.svn.wordpress.org/trunk@54036 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-11 13:45:13 +00:00
audrasjb
c985972791 Posts, Post Types: Ensure all entries in the list returned by wp_parse_list() are scalar.
This changeset fixes a warning where `strip_tags()` expected its first parameter to be a string rather than an array. It contains the following changes:

- Removal of sanitize_callback to allow the REST API to handle the validation natively, this also causes the proper error to be output for `?slug[0][1]=2` that it's an invalid value.
- Ensure that `wp_parse_list()` only returns a single-dimensioned array, even if passed a multi-dimension array, which fits the functions expected use case and resolves warnings in code that expects the function to return a single-dimensioned array.

Props dd32, TimothyBlynJacobs.
Fixes #55838.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54035 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-11 13:25:11 +00:00
audrasjb
88b54dc6be Twenty Ten: Adjust Pullquote Block paragraph font size.
This changeset adjusts the size of paragraphs located inside the Pullquote block to account for changes introduced in [82509b6439 (diff-b45331d9b1b9f01d24ffd110e357ce5722772b0a14303ba72ca216c613fc8076) Gutenberg PR 43195]. This ensures the size of the paragraph is set to 1.5em in the editor.

Props sabernhardt.
Fixes #56730.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54034 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-11 12:42:17 +00:00
audrasjb
907986ff68 Formatting: Strip object replacement characters from slugs.
This changeset prevents object replacement characters – UTF-8 `%ef%bf%bc`, used as a placeholder in text for an otherwise unspecified object – from being added to slugs.

Props cantuaria, costdev, audrasjb, SergeyBiryukov, archon810, maciejmackowiak, BaneD, markparnell, ironprogrammer, dmsnell, nikkigagency, webprom.
Fixes #55117.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54033 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-11 10:28:16 +00:00
audrasjb
85975c0104 I18N: Revert [54469].
This changeset reverts [54469] as there is currently no support for parsing JS i18n functions in PHP files which means the strings won't be translatable.

Props ocean90.
Unprops audrasjb.
See #37287.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54032 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-11 10:05:16 +00:00
audrasjb
1d58ed2b6c Build/Test Tools: Add unit test for non-existing block-styles registration.
Follow-up to [54155].

Props aristath, mukesh27.
Fixes #56664.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54031 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-11 10:00:13 +00:00
John Blackbourn
b0890afdfb Taxonomy: Correct an invalid @param tag.
See #55646

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


git-svn-id: http://core.svn.wordpress.org/trunk@54030 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-11 09:56:11 +00:00
John Blackbourn
f9db66d504 Docs: Various improvements to inline docblocks.
See #55646

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


git-svn-id: http://core.svn.wordpress.org/trunk@54029 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-11 09:02:14 +00:00
audrasjb
287a3c3120 I18N: Use wp.i18n._n() for plural forms in wp_print_admin_notice_templates().
This changeset adds better support for plural forms in update admin notices generated on the Themes and Plugins screens. This fixes issues when translating into languages that have more than one plural form, or more complicated rules for singular form usage.

Props ideag, SergeyBiryukov, daledupreez, audrasjb.
Fixes #37287.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54028 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-11 08:47:12 +00:00
desrosj
8608cdcee8 XML-RPC: Avoid loopback request in blogger.getUsersBlogs.
The `blogger.getUsersBlogs` endpoint does not currently work on Multisite environments which require HTTPS.

This changes `wp_xmlrpc_server::_multisite_getUsersBlogs()` to call the method directly instead of relying on a new `IXR_Client` request, which only supports HTTP.

Props dd32.
Fixes #56492.
Built from https://develop.svn.wordpress.org/trunk@54468


git-svn-id: http://core.svn.wordpress.org/trunk@54027 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-11 01:46:14 +00:00
desrosj
52b8697b05 Twenty Twenty-Three: Bug fixes and improvements for RC1.
Most notably in this update, Twenty Twenty-Three becomes the second default theme to have the “Accessibility Ready” tag.

For a full list of changes being included, see the `twentytwentythree` repository on GitHub: ca662828b7...4ea5d832ec.

Follow up to [54235], [54236], [54312], [54372].

Props mikachan, madhudollu, tahmidulkarim, joen, poena, scruffian, beafialho, colorful-tones, audrasjb, critterverse, luminuu, wildworks, hiyascout, desrosj.
Fixes #56383.
Built from https://develop.svn.wordpress.org/trunk@54467


git-svn-id: http://core.svn.wordpress.org/trunk@54026 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-11 00:44:12 +00:00
audrasjb
e46fe0fa32 Twenty Nineteen: Add missing compiled CSS declarations after [54413].
Follow-up to [54413].

Props sabernhardt, whaze.
Fixes #55981.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54025 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-10 23:15:12 +00:00
Peter Wilson
a04ba2a0b4 Embeds: Revert Google Data Studio as trusted provider.
Remove Google Data Studio's status as a trusted oEmbed provider pending upstream implementation of the oEmbed specification.

See #55771.


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


git-svn-id: http://core.svn.wordpress.org/trunk@54024 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-10 23:11:12 +00:00
audrasjb
81e88ecaa5 Query: Prevent PHP notice when get_post_type_object() returns null in is_post_type_archive().
This changeset avoids potential PHP notices caused by `get_post_type_object()` returning `null` when called inside `is_post_type_archive()`.

Props sean212, costdev.
Fixes #56287.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54023 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-10 23:03:14 +00:00
audrasjb
8ad3828d20 Twenty Seventeen: Prevent scaling issues on featured images using Safari on iPadOS.
This changeset ensures `background-attachment` is set to `scroll` for parallax images when the browser is iOS Safari and the screen is at least 48em (768px) wide. Narrower screens have the default `scroll` value regardless of the browser. It prevents from scaling issues on the images featured on the front page using Twenty Seventeen.

Props JarretC, sabernhardt, mrfoxtalbot, dkotter.
Fixes #48195.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54009 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-10 21:56:11 +00:00
audrasjb
d95f088a3e General: Remove instances of _wp_http_referer from GET forms in the admin.
This changeset removes all instances of `_wp_http_referer` variable from the URL when creating a hidden input for `_wp_http_referer`. It prevents the hidden field from having an additional version of `_wp_http_referer` each time the form is submitted.

Props msolution, justinahinon, pbearne, mikeschroder, mukesh27, audrasjb, Clorith, chaion07, robinwpdeveloper, hztyfoon, davidbaumwald, costdev, adamsilverstein.
Fixes #54106.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54008 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-10 18:59:11 +00:00
Sergey Biryukov
f821fa413e Cache API: Introduce wp_cache_supports() function.
WordPress has recently introduced a variety of caching API improvements:

* `wp_cache_add_multiple()`
* `wp_cache_set_multiple()`
* `wp_cache_get_multiple()`
* `wp_cache_delete_multiple()`
* `wp_cache_flush_runtime()`
* `wp_cache_flush_group()`

Although WordPress core provides a compatibility layer if these functions are missing from third-party object cache implementations, there should be a method of checking whether the cache backend supports a particular feature.

This commit aims to improve developer experience by allowing third-party object cache plugins to declare a `wp_cache_supports()` function and correctly list their supported features:

* `add_multiple`
* `set_multiple`
* `get_multiple`
* `delete_multiple`
* `flush_runtime`
* `flush_group`

Note: The `wp_cache_supports()` function replaces and supersedes the `wp_cache_supports_group_flush()` function added earlier.

Follow-up to [47938], [47944], [52700], [52703], [52706], [52708], [53763], [53767], [54423].

Props johnjamesjacoby, tillkruess, spacedmonkey, SergeyBiryukov.
Fixes #56605.
Built from https://develop.svn.wordpress.org/trunk@54448


git-svn-id: http://core.svn.wordpress.org/trunk@54007 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-10 18:22:11 +00:00
Sergey Biryukov
e7da835a36 Login and Registration: Rename is_login_screen() function to is_login().
As the function can be used in a variety of contexts, the `_screen` suffix may not always be appropriate.

This commit aims to reduce confusion by renaming the newly added `is_login_screen()` function to `is_login()`, which better aligns with `is_admin()` and the related `is_*_admin()` function family.

While it does not save a lot of lines of code, this function aims to save developers some time that would otherwise be spent investigating the most reliable way to determine whether the current request is for the login screen.

Implementation details:
* By checking `wp_login_url()`, the function accounts for custom login locations set via the `login_url` filter.
* By checking `$_SERVER['SCRIPT_NAME']` directly, instead of `did_action( 'login_form_login' )` or `$pagenow` global, the function can work as early as possible, for example in a must-use plugin.

Follow-up to [53884].

Props azaozz.
Fixes #19898. See #56400.
Built from https://develop.svn.wordpress.org/trunk@54447


git-svn-id: http://core.svn.wordpress.org/trunk@54006 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-10 17:59:12 +00:00
Sergey Biryukov
d161399285 Tests: Use assertSame() in some WP_Theme_JSON tests.
This ensures that not only the return values match the expected results, but also that their type is the same.

Previously committed in [54402], these instances appear to be accidentally reverted to `assertEquals()` in [54443].

Follow-up to [52275], [54162], [54402], [54443].

See #55654.
Built from https://develop.svn.wordpress.org/trunk@54446


git-svn-id: http://core.svn.wordpress.org/trunk@54005 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-10 15:59:11 +00:00
davidbaumwald
711c24d3a7 Editor: Dynamic site editor template names performance improvements.
This change updates `get_(posts|terms)()` to direct `WP_Query` calls and adds additional parameters to each query to improve performance.

Follow-up to [54280], [54333], [54370], and [54388].

Props spacedmonkey, peterwilsoncc.
See #56467.
Built from https://develop.svn.wordpress.org/trunk@54445


git-svn-id: http://core.svn.wordpress.org/trunk@54004 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-10 15:17:13 +00:00
audrasjb
411e2b8580 Build/Test Tools: Add missing newline character on unit tests files after [54443].
Follow-up to [54443].

See #56611.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54003 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-10 15:03:13 +00:00
audrasjb
50b0731750 Build/Test Tools: Expand unit tests for theme.json.
This changeset adds unit test coverage for the following features:

- Gradients
- `filter` (Duotones)
- `blockGap`
- `shadow`
- `useRootPaddingAwareAlignments`
- `appearanceTools`

Props gunterer, johnregan3, audrasjb, mukesh27.
Fixes #56611.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54002 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-10 14:54:11 +00:00
audrasjb
c5f189c4a1 Upgrade/Install: Provide dirpath in error messages when _unzip_file_pclzip() cannot create directories.
This changeset ensures the directory path is provided in error messages when `_unzip_file_pclzip()` is unable to create a directory. This removes `substr()` which was returning an empty string in some use cases.

Props gunterer, SergeyBiryukov, n8finch, peterwilsoncc, audrasjb, rsiddharth, costdev , desrosj, mukesh27.
Fixes #54477.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54001 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-10 12:48:14 +00:00
audrasjb
f4521ee2a1 Docs: Improve wp_get_object_terms() return type.
Props dd32, audrasjb, desrosj, mukesh27.
Fixes #56327.
See #55646.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54000 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-10 12:30:16 +00:00
audrasjb
1795435a9f Users: Fix Users list bottom filters margins on small screens.
This changeset fixes bottom filters margins of the Users list screen on small screens.

Props sumitsingh, sabernhardt, shreyasikhar26, audrasjb.
Fixes #54813.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53988 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-09 23:02:31 +00:00
Sergey Biryukov
7b8972ba63 Tests: Minimize file copying in WP_REST_Attachments_Controller tests.
The tests use two images that were deleted on teardown and recreated on setup for every single test. This appears to be unnecessary, as the files can instead only be recreated if they are missing, and deleted after the test run is complete.

This commit reduces ~200 redundant file copying operations to ~5 when running this test class.

Follow-up to [38832], [48291], [54424].

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


git-svn-id: http://core.svn.wordpress.org/trunk@53987 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-09 17:47:27 +00:00
Sergey Biryukov
05c3709db3 External Libraries: Upgrade PHPMailer to version 6.6.5.
This is a maintenance release with minor changes:
* Don't try to issue `RSET` if there has been a connection error.
* Reject attempts to add folders as attachments.
* Don't suppress earlier error messages on `close()`.
* Handle `Host === null` better.

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

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

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

Props ayeshrajans, Synchro.
Fixes #56772.
Built from https://develop.svn.wordpress.org/trunk@54427


git-svn-id: http://core.svn.wordpress.org/trunk@53986 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-09 17:12:31 +00:00
Sergey Biryukov
2e827f55b4 Coding Standards: Correct alignment in test_import_theme_starter_content().
This fixes an `Equals sign not aligned correctly` WPCS warning.

Follow-up to [54425].

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


git-svn-id: http://core.svn.wordpress.org/trunk@53985 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-09 16:39:28 +00:00
Sergey Biryukov
98ae9ab132 Tests: Clean up test images in WP_Customize_Manager tests.
The test for `WP_Customizer_Manager::import_theme_starter_content()` creates two attachments that remain in the `uploads` directory after the test run is complete.

This commit follows the approach from `WP_REST_Posts_Controller` tests and utilizes an `$attachments_created` property to track any files uploaded in the current test run and clean them up afterwards.

This makes sure there are no leftover images after the test class is run.

Follow-up to [39276], [39346], [39411], [40142], [53935], [54424].

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


git-svn-id: http://core.svn.wordpress.org/trunk@53984 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-09 16:28:30 +00:00
Sergey Biryukov
c8257d0821 Tests: Remove unnecessary file copying in WP_Customize_Manager tests.
This was added to avoid creating leftover image sub-sizes in the version-controlled `DIR_TESTDATA` directory.

However, this does not appear to be necessary:
* `WP_Customizer_Manager::import_theme_starter_content()` already [source:tags/6.0.2/src/wp-includes/class-wp-customize-manager.php?marks=1370-1374#L1367 makes a copy of the image] before sideloading, so the test was essentially working with a copy of a copy.
* The images were only used in one test out of 70 and do not need to be copied for every single test.

Upon further investigation, there is also no evidence that creating these copies actually resolved the reported issue:
* `WP_UnitTest_Factory_For_Attachment::create_object()` inserts an attachment, but does not create image sub-sizes.
* `media_handle_sideload()` does create image sub-sizes, but the file is already in the media library by that time, and sub-sizes are created in the `uploads` directory, not in the version-controlled `DIR_TESTDATA` directory.

This commit removes ~140 redundant file copying operations when running the test suite.

Follow-up to [39276], [39346], [39411], [40142].

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


git-svn-id: http://core.svn.wordpress.org/trunk@53983 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-09 13:47:31 +00:00
Sergey Biryukov
cbe943d1d1 Tests: Add wp_cache_*_multiple() functions to Memcached implementation used in the test suite.
Since this object cache implementation was added, WordPress has introduced a variety of caching API improvements:
* `wp_cache_add_multiple()`
* `wp_cache_set_multiple()`
* `wp_cache_get_multiple()`
* `wp_cache_delete_multiple()`

Although WordPress core provides a compatibility layer if these functions are missing from third-party object caches, this commit updates the Memcached object cache used in the test suite to implement these new functions directly.

Follow-up to [40561], [47938], [47944], [52700], [52703], [52706], [52708].

Props petitphp, spacedmonkey, tillkruss, SergeyBiryukov.
Fixes #54864.
Built from https://develop.svn.wordpress.org/trunk@54423


git-svn-id: http://core.svn.wordpress.org/trunk@53982 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-08 13:41:13 +00:00
audrasjb
62edbe0bbe Build/Test Tools: Add tests coverage for _wp_check_alternate_file_names().
This changeset adds missing unit tests for this function.

Props pbearne, costdev, peterwilsoncc.
Fixes #55199.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53981 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-08 09:18:11 +00:00
audrasjb
0a0f4795bb Build/Test Tools: Add tests for WP_List_Util::pluck and WP_List_Util::sort.
This changeset adds additional unit tests for these two functions.

Props pbearne, costdev, afragen.
Fixes #55300.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53980 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-08 08:46:13 +00:00
audrasjb
22f52c83c2 Build/Test Tools: Add tests for wp_nonce_field() and wp_referer_field().
This changeset adds missing unit tests for these two functions.

Props pbearne, costdev, audrasjb.
Fixes #55578.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53979 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-07 22:19:11 +00:00
Weston Ruter
6d7dd31236 Customize: Prevent PHP notice in Customizer when using block theme.
Use the `customize_panel_active` filter to deactivate the Menus panel instead of overriding the `check_capabilities` method. This ensures the panel remains registered but is still hidden.

See #54888.
Fixes #54905.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53978 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-07 20:48:12 +00:00
audrasjb
d8175f4121 Twenty Twenty: Improve Separator Block rendering.
This changeset fixes inconsistent alignment behavior of the Separator Block in the editor.

Props kmadhak, sabernhardt, mukesh27, nidhidhandhukiya, kajalgohel.
Fixes #55910.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53977 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-07 20:42:11 +00:00
Adam Silverstein
b0a552657e Media: ensure the wp_editor_set_quality filter consistently passes the correct output mime type.
Ensure that the mime type passed to the `wp_editor_set_quality` filter is correct when the output format is altered with the `image_editor_output_format` filter and the image is saved multiple times, for example when generating sub sizes. Previously, the original image mime type was passed instead of the output type after the initial save.

Props flixos90, peterwilsoncc.
Fixes #56442.



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


git-svn-id: http://core.svn.wordpress.org/trunk@53976 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-07 19:17:12 +00:00
Adam Silverstein
2d9ac13f69 Media: improve image engine detection when using the output format filter.
When the output format is altered with the `image_editor_output_format` filter, prefer the image engine that supports both input an output types, falling back to the engine that supports the input type.

Correct an issue where the output format filter wasn't respected because the selected engine didn't support the output format.

Props mikeschroder, ironprogrammer.
Fixes #54476.



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


git-svn-id: http://core.svn.wordpress.org/trunk@53975 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-07 19:03:11 +00:00
Sergey Biryukov
59b066ef11 Blocks: Avoid extra calls to realpath() in block scripts and styles registration.
This affects:
* `register_block_script_handle()`
* `register_block_style_handle()`

Both functions set a variable with this code:
{{{
$wpinc_path_norm = wp_normalize_path( realpath( ABSPATH . WPINC ) );
}}}

That value never changes during page load, so we can save it to a static variable. By doing so, we can avoid ~200 calls to `realpath()` and `wp_normalize_path()`, or even more if third-party plugins register scripts or styles.

Follow-up to [52291], [52939], [54290], [54291], [54309], [54327].

Props aristath, mukesh27, SergeyBiryukov.
Fixes #56758.
Built from https://develop.svn.wordpress.org/trunk@54415


git-svn-id: http://core.svn.wordpress.org/trunk@53974 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-07 15:46:12 +00:00
davidbaumwald
8a8bd9192b Administration: Guard against undefined $GLOBALS['hook_suffix'] in WP_Screen::get().
When initially defaulting the screen `$id` in `WP_Screen::get()`, if the `$hook_name` parameter is not supplied, an `else` fallback uses `$GLOBALS['hook_suffix']`.  However, in some cases, `hook_suffix` doesn't exist in the global scope.  This produces an "Undefined index" notice on < PHP 8, and a warning in >= PHP 8.

This change ensures `$GLOBALS['hook_suffix']` has a value before using it as a fallback for the screen ID.

Props splendorstudio, SergeyBiryukov, htdat, mukesh27, dd32, costdev.
Fixes #49089.
Built from https://develop.svn.wordpress.org/trunk@54414


git-svn-id: http://core.svn.wordpress.org/trunk@53973 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-07 14:25:14 +00:00
audrasjb
6441d199f2 Twenty Nineteen: Ensure Pullquote Block text color is reflected on front-end.
This changeset ensures Pullquote Block text is consistent between the editor a on front-end.

Props nithins53, umesh84, sabernhardt, deepakvijayan, poena.
Fixes #55981.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53972 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-07 12:12:12 +00:00
audrasjb
ea2a6daa0b Docs: Various docblock fixes in global-styles-and-settings.php, as per documentation standards.
Follow-up to [54408].

See #55646.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53971 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-07 12:09:11 +00:00
audrasjb
cd0a4ee190 Docs: Various docblock fixes in WP_Theme_JSON class, as per documentation standards.
Follow-up to [54408].

See #55646.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53970 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-07 12:01:13 +00:00
spacedmonkey
be3c6666d9 Query: Move call to update_menu_item_cache in WP_Query
Move call to `update_menu_item_cache` in `WP_Query` to after post meta caches for menu items are primed. 

Props spacedmonkey, peterwilsoncc, mukesh27.
See #55620.
Built from https://develop.svn.wordpress.org/trunk@54410


git-svn-id: http://core.svn.wordpress.org/trunk@53969 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-07 10:00:15 +00:00
jorgefilipecosta
148049329d Fix: cite styles declared via theme.json not working.
Fixes an issue where cite elements declared on theme.json are not being output on the front end of the website.

Props oandregal, carolinan, scruffian.
See #56467.
Built from https://develop.svn.wordpress.org/trunk@54409


git-svn-id: http://core.svn.wordpress.org/trunk@53968 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-07 09:46:13 +00:00
audrasjb
ae50e2c014 Editor: Add missing blocks origin to theme.json.
This changeset updates the blocks origin name from core to blocks and adds it to the list of valid origins for `theme.json`.
(See the original fix in [https://github.com//pull/3319 Gutenberg's PR 44363]).

Why?

- This new origin was missing from the list.
- The `core` name is not reflective of what it does, as this data origin is related to block styles, whether they come with WordPress or third-party blocks.
- The existing filter for this piece of data is called `theme_json_blocks`, to reflect it filters "block" data.
- Though `core` origin was used in the past for `default`, this commit reverts it. Why? It was confusing. The goal is to use names that communicate what part of the pipeline are processing (`default > blocks > theme > custom`).

How?

- Renames the string, from `core` to `blocks`.
- Adds `blocks` to the list of valid origins.
- Verifies that the `$theme_json->get_stylesheet()` call uses the proper `$origins` at all times.

Follow-up to [54162], [54251].

Props oandregal, czapla, jorgefilipecosta, scruffian, bernhard-reiter hellofromTonya.
See #56467.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53967 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-07 09:40:13 +00:00
Peter Wilson
a1518e3bc4 Build/Test tools: Add tests for wp_nonce_url().
Props pbearne, costdev.
See #55652.
Fixes #54870.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53966 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-07 02:51:10 +00:00
desrosj
e26b369fb2 Build/Test Tools: Use require_once instead of require.
The `sync-stable-blocks.js` file is used to compile the contents of `require-dynamic-blocks.php`, which includes the PHP files required for dynamic Core blocks.

Since these files define PHP functions, `require_once` should be used instead of `require` to guard against fatal errors.

Follow up to [53688].

Props aristath, SergeyBiryukov, desrosj.
Fixes #56738. See #56179.
Built from https://develop.svn.wordpress.org/trunk@54406


git-svn-id: http://core.svn.wordpress.org/trunk@53965 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-07 01:58:11 +00:00
desrosj
7163f9fd3e Bundled Themes: Properly escape URLs.
This adds output escaping to several theme related URLs.

Props alberuni-azad, sabernhardt.
Fixes #56696.
Built from https://develop.svn.wordpress.org/trunk@54405


git-svn-id: http://core.svn.wordpress.org/trunk@53964 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-07 01:34:11 +00:00
desrosj
a35232fc60 Twenty Eleven: Pass template directory URLs through esc_url().
Props alberuni-azad, sabernhardt, costdev.
Fixes #56717. See #56696.
Built from https://develop.svn.wordpress.org/trunk@54404


git-svn-id: http://core.svn.wordpress.org/trunk@53963 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-07 01:25:10 +00:00
Sergey Biryukov
646a284e71 Tests: Clean up test image for site icon in Tests_REST_Server on teardown.
This makes sure there are no leftover images after the test class is run.

Follow-up to [52080], [53463], [53920].

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


git-svn-id: http://core.svn.wordpress.org/trunk@53962 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-07 01:09:11 +00:00
desrosj
5adad0ead8 Tests: Replace some occurrences of assertEquals() with assertSame().
This ensures that not only the return values match the expected results, but also that their type is the same.

Props costdev, desrosj.
See #55654.
Built from https://develop.svn.wordpress.org/trunk@54402


git-svn-id: http://core.svn.wordpress.org/trunk@53961 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-07 01:04:11 +00:00
Sergey Biryukov
1d10384608 Tests: Bring some consistency to WP_Image_Editor_GD and WP_Image_Editor_Imagick tests.
Includes:
* Adjusting test method descriptions and comments per the documentation standards.
* Creating image editor class instances directly, instead of calling `wp_get_image_editor()`.
* Cleaning up temporary files before performing assertions, where possible.
* Using more consistent variable names for image editor class instances.
* Reordering some test methods.

Follow-up to [1182/tests], [1188/tests], [27794], [30549], [30990], [31040], [39580], [40123], [49230], [49488], [49542], [49751].

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


git-svn-id: http://core.svn.wordpress.org/trunk@53960 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-07 00:42:12 +00:00
desrosj
0edbc3da00 Build/Test Tools: Update npm dependencies to their latest versions.
This updates the following `devDependencies`:

- `chalk` from `5.0.1` to `5.1.0`
- `dotenv` from `16.0.2` to `16.0.3`
- `sinon` from `14.0.0` to `14.0.1`
- `uglify-js` from `3.17.1` to `3.17.3`

This is the final dependency bump for 6.1.

See #56641.
Built from https://develop.svn.wordpress.org/trunk@54400


git-svn-id: http://core.svn.wordpress.org/trunk@53959 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-06 18:57:22 +00:00
davidbaumwald
428915d739 Editor: Ensure block styles in theme.json are rendered.
This change removes the caching of theme data in `WP_Theme_JSON_Resolver::get_theme_data()`, instead freshly compiling theme data on each call.

Also, to prevent any performance degradation by the removal, the file contents of `theme.json` files are now cached in `WP_Theme_JSON_Resolver::read_json_file()`, preventing multiple filesystem reads.

Follow-up to [54385].

Props ndiego, bph, mikachan, andrewserong, oandregal, cbravobernal, bernhard-reiter, aristath.
Fixes #56736.
Built from https://develop.svn.wordpress.org/trunk@54399


git-svn-id: http://core.svn.wordpress.org/trunk@53958 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-06 18:02:10 +00:00
Sergey Biryukov
4943dbf577 Themes: Replace array_map() usage in WP_Theme_JSON::get_default_slugs().
When loading a page on the frontend using Xdebug & Webgrind, with the Twenty Twenty-Three theme and no plugins activated, the biggest performance bottleneck currently (on the PHP side) is `WP_Theme_JSON::merge()`. Analysing the data a bit more, it became evident that `WP_Theme_JSON::get_default_slugs()` is the part of that method which takes most of the resources and time.

Further analysis of the method revealed that `array_map()` was the call that slowed it down.

This commit replaces the `array_map()` call with a simple `foreach` loop, improving page load speed significantly.

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

Props aristath.
Fixes #56745.
Built from https://develop.svn.wordpress.org/trunk@54398


git-svn-id: http://core.svn.wordpress.org/trunk@53957 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-06 15:27:13 +00:00
Peter Wilson
b879d04354 Users: Revert use of shared objects for current user.
Reverts [50790].

Props oztaser, ravipatel, dd32, costdev, SergeyBiryukov, tykoted, cu121, xknown.
Fixes #54984.


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


git-svn-id: http://core.svn.wordpress.org/trunk@53956 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-06 04:38:14 +00:00
Sergey Biryukov
14f891f733 Tests: Add comments to clarify a REST API test for password protected posts.
Authenticated users should only be allowed to read password protected content if they have the `edit_post` meta capability for the post. In other words, the content of a password protected post created by an Editor should not be viewable by a Contributor.

This commit aims to clarify the usage of a negative assertion `assertStringNotContainsString()` and describe the intention behind the test to avoid confusion.

Follow-up to [50717].

Fixes #56681.
Built from https://develop.svn.wordpress.org/trunk@54396


git-svn-id: http://core.svn.wordpress.org/trunk@53955 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-05 14:49:13 +00:00
audrasjb
81cbe2c55b General: Add a default font-style value for Adminbar links.
If a theme includes a `theme.json` file and sets a specific `font-style` on links, the font-style also changes the links in the WordPress admin bar, when the admin bar is visible on front-end. For example, this happens with the `pitch` style variation of Twenty Twenty-Three.

Using a default value for the `font-style` property prevents `theme.json` files from overriding it.

Props audrasjb, poena.
Fixes #56737.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53954 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-05 14:09:11 +00:00
Sergey Biryukov
160d25ed91 Tests: Ignore EOL differences in Style Engine API tests.
Unix vs. Windows EOL style mismatches can cause misleading failures in tests using the heredoc syntax (`<<<`) or multiline strings as the expected result.

This resolves two failures when running the test suite on Windows along the lines of:
{{{
1) Tests_Style_Engine_wpStyleEngineCSSRule::test_should_prettify_css_rule_output
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
 #Warning: Strings contain different line endings!
-'.baptiste {
-       margin-left: 0;
-       font-family: Detective Sans;
+'.baptiste {
+       margin-left: 0;
+       font-family: Detective Sans;
}'

/var/www/tests/phpunit/tests/style-engine/wpStyleEngineCssRule.php:159
}}}

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

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


git-svn-id: http://core.svn.wordpress.org/trunk@53953 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-05 14:06:15 +00:00
Gary Pendergast
32a7a3b5cd Embeds: Add support for Tumblr Dashboard URLs.
WordPress has supported embedding Tumblr blog network posts since 4.2.0. This commit adds support for embedding posts using Tumblr Dashboard URLs.

Fixes #56733.


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


git-svn-id: http://core.svn.wordpress.org/trunk@53952 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-05 00:15:11 +00:00
audrasjb
009cd01c3b Administration: Avoid menu/sub-menu overlap on small screens.
This changeset fixes overlapping glitches discovered in WordPress Admin menu behavior when used on small screens.

Props turtlepod, collieit, chaion07, hilayt24, mehedi890, markparnell, webcommsat, mehedi890, ryokuhi, sabernhardt, ironprogrammer, audrasjb, costdev, ugyensupport.
Fixes #32747.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53951 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-04 23:12:08 +00:00
audrasjb
50309fa1e3 Docs: Various docblock fixes in WP_Rewrite class, as per documentation standards.
See #55646.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53950 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-04 23:01:13 +00:00
davidbaumwald
42552675cc Post WordPress 6.1 Beta 3 version bump.
Built from https://develop.svn.wordpress.org/trunk@54390


git-svn-id: http://core.svn.wordpress.org/trunk@53949 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-04 17:51:14 +00:00
davidbaumwald
7641a389bb WordPress 6.1 Beta 3.
Built from https://develop.svn.wordpress.org/trunk@54389


git-svn-id: http://core.svn.wordpress.org/trunk@53948 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-04 17:27:11 +00:00
davidbaumwald
9fc0351883 Editor: Sync latest @wordpress/edit-site package to include dynamic template names updates.
Updates `@wordpress/edit-site` from version 4.14.5 to version 4.14.6.

Follow-up to [54280], [54333], and [54370].

Props bernhard-reiter.
See #56467.
Built from https://develop.svn.wordpress.org/trunk@54388


git-svn-id: http://core.svn.wordpress.org/trunk@53947 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-04 17:03:24 +00:00
davidbaumwald
a8af293608 Editor: Fix server-side attribute registration via typography support.
Ensures the `fontFamily` attribute is registered for block types on the server side. This change resolves a `400` error when attempting to change the font family for a server-side rendered block in the editor.

Props aaronrobertshaw, mamaduka, wildworks, upadalavipul.
See #56467.
Built from https://develop.svn.wordpress.org/trunk@54387


git-svn-id: http://core.svn.wordpress.org/trunk@53946 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-04 16:47:13 +00:00
desrosj
436bf77300 External Libraries: Update clipboard and polyfill-library.
This updates the Clipboard.js and `polyfill-library` dependencies to their latest versions (`2.0.11` and `4.4.0`, respectively).

Fixes #56670.
Built from https://develop.svn.wordpress.org/trunk@54386


git-svn-id: http://core.svn.wordpress.org/trunk@53945 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-04 15:55:23 +00:00
davidbaumwald
335ecfdca9 Editor: Invalidate blocks metadata cache when needed in WP_Theme_JSON::get_blocks_metadata().
This change ensures that user-supplied global styles settings for blocks aren't lost due to sanitization.  This could previously occur due to outdated blocks metadata that did not include all registered blocks.

Props jorgefilipecosta, andrewserong, oandregal, talldanwp, cbravobernal, bernhard-reiter, hellofromTonya.
Fixes #56644.
Built from https://develop.svn.wordpress.org/trunk@54385


git-svn-id: http://core.svn.wordpress.org/trunk@53944 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-04 15:50:12 +00:00
Sergey Biryukov
2ede19910a Database: Correct MariaDB version check in wpdb::has_cap().
MariaDB version is reported differently between PHP versions:
* PHP 8.0.16 or later: `10.6.8-MariaDB`
* PHP 8.0.15 or earlier: `5.5.5-10.6.8-MariaDB`

The latter includes PHP 7.4.x and PHP 5.6.x as well, where the version is also reported with the `5.5.5-` prefix.

This commit makes an adjustment to `wpdb::has_cap()` to check for the correct MariaDB version.

This resolves an issue where the `utf8mb4_unicode_520_ci` collation, which is available in MariaDB since version 10.2, was previously not detected correctly.

References:
* [https://github.com/php/php-src/issues/7972 php-src: #7972: MariaDB version prefix 5.5.5- is not stripped]
* [https://github.com/php/php-src/pull/7963 php-src: PR #7963 Fix GH-7932: MariaDB version prefix not always stripped]
* [https://mariadb.com/docs/reference/mdb/collations/utf8mb4_unicode_520_ci/ MariaDB Documentation: utf8mb4_unicode_520_ci]

Follow-up to [37523], [53919].

Props jamieburchell, SergeyBiryukov.
Fixes #54841.
Built from https://develop.svn.wordpress.org/trunk@54384


git-svn-id: http://core.svn.wordpress.org/trunk@53943 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-04 15:41:18 +00:00
davidbaumwald
4de88db482 Editor: Update packages for 6.1 Beta 3.
Package updates for bug and regression fixes:

* @wordpress/annotations: 2.17.3
* @wordpress/block-directory: 3.15.4
* @wordpress/block-editor: 10.0.4
* @wordpress/block-library: 7.14.4
* @wordpress/blocks: 11.16.4
* @wordpress/components: 21.0.4
* @wordpress/core-data: 5.0.4
* @wordpress/customize-widgets: 3.14.4
* @wordpress/data: 7.1.3
* @wordpress/data-controls: 2.17.3
* @wordpress/edit-post: 6.14.4
* @wordpress/edit-site: 4.14.5
* @wordpress/edit-widgets: 4.14.4
* @wordpress/editor: 12.16.4
* @wordpress/format-library: 3.15.4
* @wordpress/interface: 4.16.3
* @wordpress/keyboard-shortcuts: 3.15.3
* @wordpress/list-reusable-blocks: 3.15.4
* @wordpress/notices: 3.17.3
* @wordpress/nux: 5.15.4
* @wordpress/preferences: 2.9.4
* @wordpress/reusable-blocks: 3.15.4
* @wordpress/rich-text: 5.15.3
* @wordpress/server-side-render: 3.15.4
* @wordpress/style-engine: 1.0.3
* @wordpress/viewport: 4.15.3
* @wordpress/widgets: 2.15.4

References:
* [https://github.com/WordPress/gutenberg/pull/44634 Gutenberg PR 44634] – Quote block: stop slash inserter popup showing in citation
* [https://github.com/WordPress/gutenberg/pull/44630 Gutenberg PR 44630] – Query Loop: Fix condition for displaying 'parents' control
* [https://github.com/WordPress/gutenberg/pull/44554 Gutenberg PR 44554] – Hide the Classic block in the Site Editor
* [https://github.com/WordPress/gutenberg/pull/44594 Gutenberg PR 44594] – Fix navigation block console error
* [https://github.com/WordPress/gutenberg/pull/44555 Gutenberg PR 44555] – Theme export: Fix broken spacingScale export
* [https://github.com/WordPress/gutenberg/pull/44580 Gutenberg PR 44580] – Code Block: Add box-sizing to fix inconsistent layout
* [https://github.com/WordPress/gutenberg/pull/44556 Gutenberg PR 44556] – Remove border from Global Styles previews
* [https://github.com/WordPress/gutenberg/pull/44141 Gutenberg PR 44141] – Spacing presets: Modify the styling of the input controls when in unlinked mode in order to better differentiate sides
* [https://github.com/WordPress/gutenberg/pull/44453 Gutenberg PR 44453] – Preserve the generic signature of getEntityRecord and getEntityRecords through currying
* [https://github.com/WordPress/gutenberg/pull/44504 Gutenberg PR 44504] – Theme.json: fix some outline properties doesn't work properly on the editor
* [https://github.com/WordPress/gutenberg/pull/44516 Gutenberg PR 44516] – Add style engine to editor tsconfig references
* [https://github.com/WordPress/gutenberg/pull/44523 Gutenberg PR 44523] – Query Loop Block: Rename Query Loop variations allowControls to allowedControls
* [https://github.com/WordPress/gutenberg/pull/44520 Gutenberg PR 44520] – Post Featured Image: Fix application of default border style in editor
* [https://github.com/WordPress/gutenberg/pull/44286 Gutenberg PR 44286] – Post Featured Image: Fix borders after addition of overlay feature
* [https://github.com/WordPress/gutenberg/pull/44482 Gutenberg PR 44482] – Template Editor: Fix crashes due to undefined variables
* [https://github.com/WordPress/gutenberg/pull/44480 Gutenberg PR 44480] – Template Parts: Prevent adding block in post editor or inside post template or content blocks
* [https://github.com/WordPress/gutenberg/pull/44425 Gutenberg PR 44425] – Fix rotated image crop area aspect ratio
* [https://github.com/WordPress/gutenberg/pull/44485 Gutenberg PR 44485] – Fix padding/margin visualizer accuracy
* [https://github.com/WordPress/gutenberg/pull/44569 Gutenberg PR 44569] – Theme.json: Fix some shadow properties that do not work properly in the site editor
* [https://github.com/WordPress/gutenberg/pull/44575 Gutenberg PR 44575] – ToggleGroupControl: Fix unselected icon color
* [https://github.com/WordPress/gutenberg/pull/44526 Gutenberg PR 44526] – TokenInput Field: Try alternative approach to fix screen reader focus issue
* [https://github.com/WordPress/gutenberg/pull/44506 Gutenberg PR 44506] – Edit Post: Optimize legacy post content layout
* [https://github.com/WordPress/gutenberg/pull/44258 Gutenberg PR 44258] – Add layout styles from Post Content block to post editor

Follow-up to [54257] and [54335].

Props czapla, isabel_brison, wildworks, bernhard-reiter, hellofromTonya.
See #56467.
Built from https://develop.svn.wordpress.org/trunk@54383


git-svn-id: http://core.svn.wordpress.org/trunk@53942 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-04 15:06:52 +00:00
hellofromTonya
9017d4beb0 Editor: Add PHPUnit tests for 5.9.0 new functions.
During the 5.9.0 cycle, tests were missed during the porting from Gutenberg to Core for the following functions:

* `_disable_block_editor_for_navigation_post_type()`
* `_disable_content_editor_for_navigation_post_type()`
* `_enable_content_editor_for_navigation_post_type()`
* `wp_filter_global_styles_post()`

This commit adds new test classes for these functions.

Reference:
* [https://github.com/WordPress/gutenberg/blob/release/13.6/phpunit/global-styles-test.php Gutenberg v13.6] for `WP_Global_Styles_Test`
* [https://github.com/WordPress/gutenberg/blob/release/13.6/phpunit/navigation-test.php Gutenberg v13.6] for `WP_Navigation_Test`

Follow-up to [52298], [52145], [52052].

Props antonvlasenko, costdev, ironprogrammer, robinwpdeveloper, hellofromTonya.
Fixes #56266.
Built from https://develop.svn.wordpress.org/trunk@54382


git-svn-id: http://core.svn.wordpress.org/trunk@53941 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-04 14:22:14 +00:00
audrasjb
13b79b4a3b Twenty Sixteen: Improve Pullquote Block text color consistency between editor and front-end.
This changeset ensures the text color selected for the text of the Pullquote Block is reflected on both front-end and on the editor.

Props nithins53, nidhidhandhukiya, audrasjb, sabernhardt, poena.
Fixes #56008.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53940 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-04 08:22:10 +00:00
Peter Wilson
ac8cba8791 Docs: Correct docblocks for get_block_file_template().
This corrects the docblock for `get_block_file_template()` and the filters it contains: `pre_get_block_file_template` and `get_block_file_template`.

Prior to this change they were incorrectly documented with the docblocks for `get_block_template()` and its associated filters.

Props felipeelia.
Fixes #55929.


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


git-svn-id: http://core.svn.wordpress.org/trunk@53939 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-04 04:29:08 +00:00
Peter Wilson
d7e3d069a1 Security: Additional translations of salt default phrase.
Translate the default salt value "put your unique phrase here" in additional locations in which it is used. This further ensures that the default phrase is considered an error in non-english translations of `wp-config.php`.

Follow-up to [54249].

Props peterwilsoncc, audrasjb, JeffPaul.
Fixes #55937.


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


git-svn-id: http://core.svn.wordpress.org/trunk@53938 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-04 03:59:13 +00:00
Peter Wilson
566caa07ae Administration: Remove private delegation from list tables.
Remove the private delegation from the following classes and function:

* `WP_List_Table`
* `WP_Application_Passwords_List_Table`
* `WP_Comments_List_Table`
* `WP_Links_List_Table`
* `WP_Media_List_Table`
* `WP_MS_Sites_List_Table`
* `WP_MS_Themes_List_Table`
* `WP_MS_Users_List_Table`
* `WP_Plugin_Install_List_Table`
* `WP_Plugins_List_Table`
* `WP_Post_Comments_List_Table`
* `WP_Posts_List_Table`
* `WP_Terms_List_Table`
* `WP_Theme_Install_List_Table`
* `WP_Themes_List_Table`
* `WP_Users_List_Table`
* `_get_list_table()`

This change is to reflect the reality that list tables are very, very, very widely used by extenders and backward compatibility therefore needs to be maintained.

Introduces the filter `wp_list_table_class_name` within `_get_list_table()` to allow extenders to modify the list table returned for custom screens.

Props audrasjb, birgire, costdev, desrosj, faison, johnbillion, jrbeilke, kurtpayne, milana_cap, miqrogroove, nacin, peterwilsoncc, scribu, sergeybiryukov, sirzooro, westonruter, wonderboymusic.
Fixes #18449.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53937 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-04 03:47:15 +00:00
Peter Wilson
336517fab3 Posts, Post types: Prevent get_page_by_title() parsing query twice.
In `get_page_by_title()` access the populated `WP_Query::posts` property directly rather than via the `WP_Query::get_posts()` method. This removes unnecessary reprocessing of the query.

Follow up to [54234].

Props david.binda, mukesh27, spacedmonkey.
Fixes #56721.


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


git-svn-id: http://core.svn.wordpress.org/trunk@53936 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-04 03:33:10 +00:00
desrosj
e63726d593 External Libraries: Update getID3 to version 1.9.22.
This updates the getID3 library from version `1.9.21` to `1.9.22`, which contains a number of bug fixes and improvements to PHP 8.1 support.

A full list of changes can be found on GitHub: https://github.com/JamesHeinrich/getID3/compare/v1.9.21...v1.9.22.

Props jrf, desrosj.
Fixes #56692.
Built from https://develop.svn.wordpress.org/trunk@54376


git-svn-id: http://core.svn.wordpress.org/trunk@53935 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-04 02:08:11 +00:00
desrosj
aade6aa5f9 Build/Test Tools: Note the versions of NodeJS and npm supported.
This adds a note to the Getting Started section of the `README.md` file mentioning that NodeJS `14.x` and npm `6.x` is currently required to spin up a development environment.

Props elpanda13gmailcom, robinwpwebdeveloper, jakariaistauk, hztyfoon, seakashdiu, rudlinkon, fuadragib.
Fixes #55903.
Built from https://develop.svn.wordpress.org/trunk@54375


git-svn-id: http://core.svn.wordpress.org/trunk@53934 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-04 01:52:09 +00:00
desrosj
9d727a185d Twenty Seventeen: Update the scrollTo jQuery plugin.
This updates the `scrollTo` jQuery plugin included in Twenty Seventeen to the latest version, `2.1.3`.

For a full list of changes in this update, see GitHub: https://github.com/flesler/jquery.scrollTo/compare/2.1.2...v2.1.3.

Props sarahricker, mukesh27, desrosj.
Fixes #56702.
Built from https://develop.svn.wordpress.org/trunk@54374


git-svn-id: http://core.svn.wordpress.org/trunk@53933 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-04 01:43:12 +00:00
desrosj
ac5a80451f Build/Test Tools: Update github-script action to the latest version.
The latest version of the `actions/github-script` action fixes an issue where passing options to the action would remove any default values not passed (see https://github.com/actions/github-script/pull/293).

This also includes updates to other third-party actions, bringing all third-party versions in Core workflows to their latest versions:
- `actions/cache`
- `actions/setup-node`
- `codecov/codecov-action`

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


git-svn-id: http://core.svn.wordpress.org/trunk@53932 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-04 01:27:15 +00:00
desrosj
1ea4bd7f5e Twenty Twenty-Three: Bug fixes and improvements for beta 3.
This brings over the latest bug fixes and improvements ahead of WordPress 6.1 beta 3.

For a full list of changes being included, see the `twentytwentythree` repository on GitHub: ac96e8d545...ca662828b7.

Props mikachan, poena, madhudollu, beafialho, colorful-tones, scruffian, tahmidulkarim, joen, taskotr, zoonini, mayuge, ndiego, collet.
See #56383.
Built from https://develop.svn.wordpress.org/trunk@54372


git-svn-id: http://core.svn.wordpress.org/trunk@53931 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-04 01:12:13 +00:00
desrosj
9bda85099f Build/Test Tools: Display PHPCS results in the GitHub Action logs.
When running PHPCS scans (both for checking coding standards and PHP version compatibility), the results are currently only returned silently in a format that GitHub can consume for contextually annotating any code being flagged.

This changes workflows using PHPCS to also display the results of each scan in the GitHub Action log, making it easier to find and understand what is causing failures.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53930 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-04 00:45:14 +00:00
davidbaumwald
f82413b29d Editor: Make template names and descriptions dynamic, again.
In the lead up to 6.1 Beta 2, dynamic titles and descriptions for site editor templates was deemed "feature incomplete" and [54280] was reverted.  After further consideration, this code is being re-merged in preparation for Beta 3, reverting the revert in [54333].

Follow-up to [54280] and [54333].

Props bernie, ntsekouras, jorgefilipecosta, jameskoster, cbravobernal.
See #56467.
Built from https://develop.svn.wordpress.org/trunk@54370


git-svn-id: http://core.svn.wordpress.org/trunk@53929 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-03 16:36:11 +00:00
Sergey Biryukov
91900d2639 Build/Test Tools: Remove PHP 8.1 and 8.2 from allowed failures.
With all known unit test failures now addressed, WordPress 6.1 aims to support PHP 8.1 and 8.2 as much as possible.

While full compatibility with PHP 8.1 and 8.2 is still a work in progress, this commit aims to actively prevent new PHP issues from being introduced in WordPress core.

All remaining known issues are deprecation notices. Please note, a deprecation notice is not an error, but rather an indicator of where additional work is needed for compatibility before PHP 9 (i.e. when the notices become fatal errors). With a deprecation notice, the PHP code will continue to work and nothing is broken.

Follow-up to [49077], [49162], [50299], [51588], [51604], [53922], [54072].

Props jrf, desrosj.
See #55652, #55656, #56009, #56681.
Built from https://develop.svn.wordpress.org/trunk@54369


git-svn-id: http://core.svn.wordpress.org/trunk@53928 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-03 16:03:13 +00:00
Sergey Biryukov
d83f8e682c Code Modernization: Correct default values in wp_handle_comment_submission().
This affects the following parameters subsequently passed to `wp_new_comment()`:
* `comment_author`
* `comment_author_email`
* `comment_author_url`
* `comment_content`

The default values for these parameters were previously set to `null`, causing PHP 8.1 "null to non-nullable" deprecation notices when running sanitization filters on them via `wp_filter_comment()`.

While the deprecation notices were temporarily silenced in the unit test suite, that caused an unexpected issue in a test for [source:tags/6.0.2/tests/phpunit/tests/comment-submission.php#L202 submitting a comment to a password protected post], where the `$_COOKIE[ 'wp-postpass_' . COOKIEHASH ]` value was no longer unset, as the test stopped any further execution once the deprecation notice was triggered.

Due to how WordPress handles password protected posts, once that value is set, it affects all posts protected with the same password, so this resulted in unintentionally affecting [source:tags/6.0.2/tests/phpunit/tests/rest-api/rest-posts-controller.php#L1866 another test] which happened to use the same password.

These values are all documented to be a string in various related filters, and core also expects them to be a string, so there is no reason for these defaults to be set to `null`. Setting them to an empty string instead resolves the issues.

This commit includes:
* Setting the defaults in `wp_handle_comment_submission()` to an empty string.
* Adding a dedicated unit test to verify the type of these default values.
* Removing the deprecation notice silencing as no longer needed.

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

Props jrf, desrosj, mukesh27, SergeyBiryukov.
Fixes #56712. See #56681, #55656.
Built from https://develop.svn.wordpress.org/trunk@54368


git-svn-id: http://core.svn.wordpress.org/trunk@53927 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-03 15:22:10 +00:00
davidbaumwald
a68841201d Editor: Ensure block script is enqueued, regardless of ronder_callback.
Follow-up to [54155].

Props aristath, cbravobernal.
See #56408.
Built from https://develop.svn.wordpress.org/trunk@54367


git-svn-id: http://core.svn.wordpress.org/trunk@53926 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-03 14:41:14 +00:00
Sergey Biryukov
16a24b396e Build/Test Tools: Call wpTearDownAfterClass() before deleting all data, instead of after.
As of [35186] and [51568], there are two sets of methods used for setup/teardown in the test suite before and after a test class is run:

* `set_up_before_class()` / `tear_down_after_class()`
* `wpSetUpBeforeClass()` / `wpTearDownAfterClass()`. (Note the `wp` prefix, these are WordPress' own methods and are not the same as the native PHPUnit `setUpBeforeClass()` / `tearDownAfterClass()` methods.)

The main difference is that `wpSetUpBeforeClass()` receives the `$factory` argument for ease of use, and both `wpSetUpBeforeClass()` and `wpTearDownAfterClass()` don't need to call `self::commit_transaction()`.

Many tests use the `wpTearDownAfterClass()` method to clean up posts, users, roles, etc. created via `wpSetUpBeforeClass()`. However, due to [source:tags/6.0/tests/phpunit/includes/abstract-testcase.php?marks=88-95#L82 how the method was previously called], this cleanup happened after all data is **already deleted** from the database.

This could cause some confusion when refactoring tests. For example:
{{{
public static function wpTearDownAfterClass() {
	$GLOBALS['_wp_additional_image_sizes'] = self::$_sizes;
}

public static function tear_down_after_class() {
	wp_delete_attachment( self::$large_id, true );
	parent::tear_down_after_class();
}
}}}

At a glance, it seems like these two methods can be combined:
{{{
public static function wpTearDownAfterClass() {
	wp_delete_attachment( self::$large_id, true );

	$GLOBALS['_wp_additional_image_sizes'] = self::$_sizes;
}
}}}
However, that would not work as expected: by the time `wp_delete_attachment()` runs, the attachment ID is no longer in the database, so it returns early, leaving some files in the `uploads` directory.

By calling `wpTearDownAfterClass()` in `WP_UnitTestCase_Base::tear_down_after_class()` before deleting all data, instead of after, we ensure that both of these methods have access to the same data and can be used interchangeably to perform cleanup as necessary.

Additionally, this commit moves the calls to parent methods in `WP_UnitTestCase_Base`:

* `parent::set_up_before_class()` to be the first thing called in `::set_up_before_class()`
* `parent::tear_down_after_class()` to be the last thing called in `::tear_down_after_class()`

This does not have any effect in practice, but brings consistency with how these methods are called in the test suite.

Follow-up to [35186], [35225], [35242], [38398], [39626], [49001], [51568].

Props ironprogrammer, SergeyBiryukov.
Fixes #55918. See #55652.
Built from https://develop.svn.wordpress.org/trunk@54366


git-svn-id: http://core.svn.wordpress.org/trunk@53925 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-02 15:13:13 +00:00
Sergey Biryukov
4517e90af4 Tests: Ensure prerequisites are met for draft length tests in Tests_L10n.
These three tests for `wp_dashboard_recent_drafts()` would run into a PHP 8.1 "passing null to non-nullable" deprecation for the call to `ltrim()` when the result of `get_edit_post_link()` is passed to `esc_url()`.

Setting a deprecation expectation would not solve this as the returned value would still not match the expected value(s).

The recent drafts list is only displayed on the Dashboard screen for users with the `edit_posts` capability. By setting the current user to Editor, the prerequisites for `wp_dashboard_recent_drafts()` are met, which means the deprecation notice is avoided and the assertions will succeed.

This commit addresses a few errors in the test suite along the lines of:
{{{
1) Tests_L10n::test_length_of_draft_should_be_counted_by_words
ltrim(): Passing null to parameter #1 ($string) of type string is deprecated

/var/www/src/wp-includes/formatting.php:4376
/var/www/src/wp-admin/includes/dashboard.php:657
/var/www/tests/phpunit/tests/l10n.php:449
/var/www/vendor/bin/phpunit:123
}}}

Follow-up to [45505], [52253], [52259].

Props jrf, desrosj, SergeyBiryukov.
See #56681, #55652, #55656.
Built from https://develop.svn.wordpress.org/trunk@54365


git-svn-id: http://core.svn.wordpress.org/trunk@53924 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-01 15:49:09 +00:00
Sergey Biryukov
446d463a19 Code Modernization: Check the return type of parse_url() in url_to_postid().
As per the PHP manual:
> If the `component` parameter is omitted, an associative array is returned.
> If the `component` parameter is specified, `parse_url()` returns a string (or an int, in the case of `PHP_URL_PORT`) instead of an array. If the requested component doesn't exist within the given URL, `null` will be returned.

Reference: [https://www.php.net/manual/en/function.parse-url.php#refsect1-function.parse-url-returnvalues PHP Manual: parse_url(): Return Values]

In this case, `parse_url()` is called with `PHP_URL_HOST` as `$component`, which returns `null` if the URL only has a path. The return value of `parse_url()` was then passed to `str_replace()`, leading to a notice on PHP 8.1:
{{{
str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
}}}

Adding validation for the return type value of `parse_url()` prevents that.

This commit addresses a few errors in the test suite along the lines of:
{{{
5) Tests_Rewrite::test_url_to_postid_home_has_path
str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated

/var/www/src/wp-includes/rewrite.php:503
/var/www/tests/phpunit/tests/rewrite.php:271
/var/www/vendor/bin/phpunit:123
}}}

Includes adding a dedicated unit test for a URL that only has a path.

Follow-up to [41786], [51606], [51622], [51626], [51629], [51630], [52799].

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


git-svn-id: http://core.svn.wordpress.org/trunk@53923 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-01 03:25:10 +00:00
davidbaumwald
9b493706ef Editor: Cast theme.json values to string on theme export.
Props glendaviesnz.
See #56684.
Built from https://develop.svn.wordpress.org/trunk@54363


git-svn-id: http://core.svn.wordpress.org/trunk@53922 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-30 14:48:12 +00:00
Sergey Biryukov
35fb05f30d Code Modernization: Fix null to non-nullable deprecation in WP_Theme_JSON::get_property_value().
This commit aims to fix errors caused by incorrect usage of the `strncmp()` function inside the `WP_Theme_JSON::get_property_value()` method on PHP 8.1 and above.

Some history of the affected code:
* [50973] introduced the `WP_Theme_JSON::get_property_value()` method.
* [54162] removed the `$default` parameter from the `_wp_array_get()` call in the method.

With the latter change, the default value that is returned if the path does not exist within the array, or if `$array` or `$path` are not arrays, became `null` instead of an empty string. Since `null` would then be unintentionally passed to the `strncmp()` function further in the code, this caused ~35 errors in the test suite along the lines of:
{{{
1) Tests_Blocks_Editor::test_get_block_editor_settings_theme_json_settings
strncmp(): Passing null to parameter #1 ($string1) of type string is deprecated

/var/www/src/wp-includes/class-wp-theme-json.php:1754
/var/www/src/wp-includes/class-wp-theme-json.php:1641
/var/www/src/wp-includes/class-wp-theme-json.php:2066
/var/www/src/wp-includes/class-wp-theme-json.php:1002
/var/www/src/wp-includes/class-wp-theme-json.php:898
/var/www/src/wp-includes/global-styles-and-settings.php:140
/var/www/src/wp-includes/block-editor.php:421
/var/www/tests/phpunit/tests/blocks/editor.php:388
/var/www/vendor/bin/phpunit:123
}}}

This commit includes:
* Restoring the `$default` value for `_wp_array_get()` call.
* Adding an early return if the value is an empty string or `null`.
* Adding a dedicated unit test to ensure that the method returns a string for invalid paths or `null` values.

Follow-up to [50973], [54162].

Props antonvlasenko, jrf, imadarshakshat, SergeyBiryukov.
Fixes #56620.
Built from https://develop.svn.wordpress.org/trunk@54362


git-svn-id: http://core.svn.wordpress.org/trunk@53921 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-30 00:40:11 +00:00
audrasjb
1c1e37a8a4 Plugins: Fix Upgrade icon alignment on mobile in Plugins Install screen.
This changeset ensures the upgrade icon is correctly aligned on small screens, in the Plugins Install screen.

Props rajanpanchal2028, mukesh27, robinwpdeveloper.
Fixes #55627.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53920 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-29 20:03:10 +00:00
davidbaumwald
0296dc6d98 Editor: Ensure settings for fluid typography and spacingScale are not lost on theme export.
This change adds fluid typography as a valid setting and removes `spacingScale` from the array of presets.

Props glendaviesnz, ramonopoly, tellthemachines.
See #55646.
Built from https://develop.svn.wordpress.org/trunk@54360


git-svn-id: http://core.svn.wordpress.org/trunk@53919 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-29 19:45:09 +00:00
davidbaumwald
fc0840a5f5 Docs: Add @since to wp_enqueue_classic_theme_styles() docblock.
Follow-up to [54358].

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


git-svn-id: http://core.svn.wordpress.org/trunk@53918 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-29 19:15:10 +00:00
davidbaumwald
143fd4c1f7 Editor: Reintroduce styles that were removed for classic themes.
After block CSS was merged with `theme.json` styles in [https://github.com/WordPress/gutenberg/pull/34180 Gutenberg PR #34180], this removed some existing, default styling for some elements, including buttons.  This change re-adds the removed styles by enqueueing `classic.css` for classic themes.

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

Follow-up to [54257].

Props scruffian, oandregal, ramonopoly, aristath, andrewserong, get_dave, bernhard-reiter.
See #56467.
Built from https://develop.svn.wordpress.org/trunk@54358


git-svn-id: http://core.svn.wordpress.org/trunk@53917 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-29 18:55:10 +00:00
davidbaumwald
4722fcfca8 Editor: Remove deprecated callable in WP_Style_Engine class.
Resolves a `Use of "static" in callables is deprecated` notice in = PHP 8.2 and mark `WP_Style_Engine` as a `final` class that will not be extended.

Follow-up to [54156].

Props ramonopoly, jrf, andrewserong.
See #56467.
Built from https://develop.svn.wordpress.org/trunk@54357


git-svn-id: http://core.svn.wordpress.org/trunk@53916 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-29 18:05:09 +00:00
davidbaumwald
ded36ac650 Editor: Remove leading whitespace from some translated strings.
Merges [https://github.com/WordPress/gutenberg/pull/44314 Gutenberg PR #44314] into trunk.

Follow-up to [54263] and [54269].

Props kebbet, bernhard-reiter.
See #56467.
Built from https://develop.svn.wordpress.org/trunk@54356


git-svn-id: http://core.svn.wordpress.org/trunk@53915 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-29 17:54:09 +00:00
Sergey Biryukov
3f512acb78 Build/Test Tools: Disable process timeout when running PHPUnit tests via Composer.
When running the full test suite locally via `npm run grunt phpunit` or `composer test`, it is not uncommon for the test run to exceed the Composer's default timeout, causing an error in the middle of the test output:
{{{
The process "..." exceeded the timeout of 300 seconds.
}}}

This commit disables the process timeout for the `composer test` command, allowing the test run to complete successfully.

Follow-up to [47881], [51016].

Props ironprogrammer, robinwpdeveloper, SergeyBiryukov.
Fixes #55919.
Built from https://develop.svn.wordpress.org/trunk@54355


git-svn-id: http://core.svn.wordpress.org/trunk@53914 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-29 14:45:10 +00:00
desrosj
0084598e3b External Libraries: Update MediaElement.js to version 4.2.17.
This is a minor bug fix release and the latest in the 4.x branch.

A full list of changes can be found on the library’s GitHub: https://github.com/mediaelement/mediaelement/releases/tag/4.2.17.

While this is not the latest version (the 5.x branch is), further testing needs to be done to confirm compatibility in WordPress. #56320 has been opened to explore this.

Props cdbessig, desrosj.
Fixes #56319.
Built from https://develop.svn.wordpress.org/trunk@54354


git-svn-id: http://core.svn.wordpress.org/trunk@53913 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-29 14:21:11 +00:00
davidbaumwald
6824b4dcbd Docs: Use Latin C instead of Cyrillic С in docblock for get_test_theme_version().
Follow-up to [48168].

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


git-svn-id: http://core.svn.wordpress.org/trunk@53912 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-29 13:55:09 +00:00
spacedmonkey
3b58a4828d Query: Save excessive cache add and sets in WP_Query.
In [53941] database query caching was added to `WP_Query`. However on sites with persistent object caching enabled, this resulted in a high number of unnecessary cache set and adds being run on every request. Caches are not set, if the query cache already exists and is cached. Replace usage of `update_post_caches` with `_prime_post_caches` to ensure that only posts that are not in cache are primed. 

Props spacedmonkey, peterwilsoncc, mukesh27.
See #22176.
Built from https://develop.svn.wordpress.org/trunk@54352


git-svn-id: http://core.svn.wordpress.org/trunk@53911 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-29 10:09:11 +00:00
Sergey Biryukov
70f3a062db I18N: Use correct default value for JavaScript translations path.
The `$path` parameter of some script translation functions had a default value of `null`, even though the parameter is documented as a string.

This commit corrects the default value for `$path` in:
* `WP_Dependency::set_translations()`
* `WP_Scripts::set_translations()`
* `wp_set_script_translations()`

Additionally, this commit removes an `is_string()` check for `$path` in `load_script_textdomain()`. Now that the default value for `$path` in that function has also been corrected to an empty string instead of `null`, that check is no longer necessary, as it would ''hide'' an error which should be ''fixed'' (at the source of the problem) instead.

Follow-up to [54349].

Props jrf, johnjamesjacoby.
See #55967, #55656.
Built from https://develop.svn.wordpress.org/trunk@54351


git-svn-id: http://core.svn.wordpress.org/trunk@53910 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-28 22:19:10 +00:00