48632 Commits

Author SHA1 Message Date
Jonathan Desrosiers
a31c785af1 Build/Test Tools: Add 6.3 to the Upgrade Testing workflow.
This adds WordPress 6.3 to the Upgrade Testing GitHub Actions workflow.

See #59805.

git-svn-id: https://develop.svn.wordpress.org/trunk@57082 602fd350-edb4-49c9-b593-d223f7449a82
2023-11-08 00:34:17 +00:00
Aaron Jorbin
9c19bc5a2c Help/About: Improve translation comment around release notes.
Props kharisblank, kebbet.
Fixes #59821.


git-svn-id: https://develop.svn.wordpress.org/trunk@57081 602fd350-edb4-49c9-b593-d223f7449a82
2023-11-07 22:56:57 +00:00
Sergey Biryukov
4e4fdcb949 Docs: Use proper case for @todo tags.
The correct tag is `@todo`, not `@TODO` or `@todo:` (note the trailing colon).

Reference: [https://developer.wordpress.org/coding-standards/inline-documentation-standards/php/#phpdoc-tags PHP Documentation Standards: PHPDoc tags].

Follow-up to [55203], [56274], [56565], [56698].

Props jrf.
See #59651.

git-svn-id: https://develop.svn.wordpress.org/trunk@57077 602fd350-edb4-49c9-b593-d223f7449a82
2023-11-07 00:12:24 +00:00
Tonya Mork
b22d0618d3 Upgrade/Install: Update $_old_files for 6.4.
Props davidbaumwald.
Fixes #59817.

git-svn-id: https://develop.svn.wordpress.org/trunk@57075 602fd350-edb4-49c9-b593-d223f7449a82
2023-11-06 17:47:32 +00:00
Jonathan Desrosiers
072b38a18b Bundled Themes: Bump versions for WP 6.4 releases.
Since every default theme was updated during the 6.4 release cycle, this bumps the version of each one.

Twenty Ten: 4.0
Twenty Eleven: 4.5
Twenty Twelve: 4.1
Twenty Thirteen: 4.0
Twenty Fourteen: 3.8
Twenty Fifteen: 3.6
Twenty Sixteen: 3.1
Twenty Seventeen: 3.4
Twenty Nineteen: 2.7
Twenty Twenty: 2.4
Twenty Twenty-One: 2.0
Twenty Twenty-Two: 1.6
Twenty Twenty-Three: 1.3

Props sabernhardt, rajinsharwar, mukesh27.
Fixes #58832.

git-svn-id: https://develop.svn.wordpress.org/trunk@57069 602fd350-edb4-49c9-b593-d223f7449a82
2023-11-06 15:19:34 +00:00
Bernie Reiter
2a93cafb52 Block Types: Add metadata global attribute.
Add a new global attribute (i.e. an attribute that can be added to all and any blocks) called `metadata`. This is required for use cases such as allowing the user to assign custom names to blocks, or for making Block Hooks work with user-modified templates/parts/patterns (#59646).

Props Mamaduka, gziolo, get_dave.
Fixes #59797.

git-svn-id: https://develop.svn.wordpress.org/trunk@57068 602fd350-edb4-49c9-b593-d223f7449a82
2023-11-06 14:45:28 +00:00
Tonya Mork
69e85003d5 Twenty Twenty-Four: Bugfixes and refinement for 6.4 RC4.
This update includes the following changes:

* [https://github.com/WordPress/twentytwentyfour/pull/723 Remove custom CSS for links].
* [https://github.com/WordPress/twentytwentyfour/pull/718 Fix the link to the theme's docs].
* [https://github.com/WordPress/twentytwentyfour/pull/719 Separate outline css to its own function] - which introduces `twentytwentyfour_block_stylesheets()` for enqueuing custom block stylesheets.
* [https://github.com/WordPress/twentytwentyfour/pull/720 Fix height of newsletter landing pattern].
* [https://github.com/WordPress/twentytwentyfour/pull/722/ Resolve border colors in variations].

Follow up to [57036], [56999], [56951], [56813], [56764], [56716].

Props onemaggie, richtabor, luminuu, huzaifaalmesbah, sabernhardt, poena, rajinsharwar.
Fixes #59812.

git-svn-id: https://develop.svn.wordpress.org/trunk@57067 602fd350-edb4-49c9-b593-d223f7449a82
2023-11-06 14:41:11 +00:00
Tonya Mork
afe96d58e8 Blocks: Document Block Hooks functions as private.
Documents the 4 new 6.4 Block Hooks global functions as private and for Core-only internal usage:

* `make_before_block_visitor()`
* `make_after_block_visitor()`
* `traverse_and_serialize_block()`
* `traverse_and_serialize_blocks()`

This is being done as the architectural design of these new functions may change in the next cycle. Further denoting them as private / Core only can help to avoid extender churn if any of these functions are deprecated.

Follow up to [56649], [56620].

Props azaozz, hellofromTonya, bernhard-reiter, gziolo, mikeschroder.
Fixes #59783.
See #59313.

git-svn-id: https://develop.svn.wordpress.org/trunk@57066 602fd350-edb4-49c9-b593-d223f7449a82
2023-11-06 13:35:28 +00:00
Sergey Biryukov
f84e228196 Docs: Replace incorrect @private tags.
The `@private` tag does not exist and is not supported. To indicate that something is private when in the global namespace, `@access private` should be used instead.

Reference: [https://developer.wordpress.org/coding-standards/inline-documentation-standards/php/#phpdoc-tags PHP Documentation Standards: PHPDoc tags].

Props jrf.
See #59651.

git-svn-id: https://develop.svn.wordpress.org/trunk@57065 602fd350-edb4-49c9-b593-d223f7449a82
2023-11-06 09:25:02 +00:00
Tonya Mork
f9429d5f93 Editor: Update of npm packages after 6.4 RC3.
This update includes the following fixes reported after RC3:

* Regression: [https://github.com/WordPress/gutenberg/pull/55858 Fixes patterns not working anymore as a post template for custom post types].

Scenario: When creating a new post for any custom post type registered with its "template" argument set to a pattern.

For this scenario, the pattern template no longer renders in the post editor or the frontend with 6.4, whereas it did render properly in 6.3.2.

This package update resolves the console error raised:
{{{
Uncaught TypeError: select(...).getCurrentTheme() is undefined 
}}}
which restores the rendering of the pattern template.

* Regression: [https://github.com/WordPress/gutenberg/pull/55859  Fixes positioning and styles for the new lightbox's trigger] introduced in 6.4.

Follow up to [57048], [57034], [56987], [56961], [56849], [56818], [56816].

Props renathoc, rajinsharwar, richtabor, joen, mikachan, hellofromTonya.
Fixes #59411.

git-svn-id: https://develop.svn.wordpress.org/trunk@57063 602fd350-edb4-49c9-b593-d223f7449a82
2023-11-05 17:13:48 +00:00
Sergey Biryukov
57d8eef46b Docs: Fix typo in a function DocBlock in WP_Duotone tests.
Follow-up to [56101], [56981].

See #59651.

git-svn-id: https://develop.svn.wordpress.org/trunk@57062 602fd350-edb4-49c9-b593-d223f7449a82
2023-11-05 16:20:40 +00:00
Sergey Biryukov
0ac7b38407 Coding Standards: Remove unnecessary ignore annotations in dbDelta().
It is perfectly possible to write a commented regex with layout for readability by using the `x` modifier.

As per the manual:
> x (`PCRE_EXTENDED`)
>
> If this modifier is set, whitespace data characters in the pattern are totally ignored except when escaped or inside a character class, and characters between an unescaped # outside a character class and the next newline character, inclusive, are also ignored. This is equivalent to Perl's /x modifier, and makes it possible to include commentary inside complicated patterns.
>
> Note, however, that this applies only to data characters. Whitespace characters may never appear within special character sequences in a pattern, for example within the sequence (?( which introduces a conditional subpattern.

Reference: [https://www.php.net/manual/en/reference.pcre.pattern.modifiers.php PHP Manual: Pattern Modifiers].

This commit rewrites these two regexes to use the `x` modifier and gets rid of the unnecessary `phpcs:disable` comments.

The tests in the `tests/phpunit/tests/db/dbDelta.php` file cover this change.

Follow-up to [42249].

Props jrf.
See #59650.

git-svn-id: https://develop.svn.wordpress.org/trunk@57061 602fd350-edb4-49c9-b593-d223f7449a82
2023-11-04 00:24:33 +00:00
Peter Wilson
75796f5e92 Build/Test Tools: Introduce tests for wp_cache_set_last_changed().
Props pbearne.
Fixes #59737.



git-svn-id: https://develop.svn.wordpress.org/trunk@57060 602fd350-edb4-49c9-b593-d223f7449a82
2023-11-03 23:27:35 +00:00
Peter Wilson
e408533070 Build/Test Tools: Fix group for wp_unique_prefixed_id() tests.
Change the group from `functions.php` to `functions` to match other tests.

See #59647.



git-svn-id: https://develop.svn.wordpress.org/trunk@57057 602fd350-edb4-49c9-b593-d223f7449a82
2023-11-03 21:53:01 +00:00
Sergey Biryukov
13192d385f Coding Standards: Remove unnecessary ignore annotation in wp_kses_hair_parse().
It is perfectly possible to write a commented regex with layout for readability by using the `x` modifier.

As per the manual:
> x (`PCRE_EXTENDED`)
>
> If this modifier is set, whitespace data characters in the pattern are totally ignored except when escaped or inside a character class, and characters between an unescaped # outside a character class and the next newline character, inclusive, are also ignored. This is equivalent to Perl's /x modifier, and makes it possible to include commentary inside complicated patterns.
>
> Note, however, that this applies only to data characters. Whitespace characters may never appear within special character sequences in a pattern, for example within the sequence (?( which introduces a conditional subpattern.

Reference: [https://www.php.net/manual/en/reference.pcre.pattern.modifiers.php PHP Manual: Pattern Modifiers].

This commit rewrites these two regexes to use the `x` modifier and gets rid of the unnecessary `phpcs:disable` comments.

The tests in the `tests/phpunit/tests/db/dbDelta.php` file cover this change.

Follow-up to [42249].

Props jrf.
See #59650.

git-svn-id: https://develop.svn.wordpress.org/trunk@57056 602fd350-edb4-49c9-b593-d223f7449a82
2023-11-03 15:31:51 +00:00
Aaron Jorbin
64bfb23202 Help/About: Update link to field guide for 6.4.
Follow up to [56950].

Props afercia.
Fixes #59289.


git-svn-id: https://develop.svn.wordpress.org/trunk@57054 602fd350-edb4-49c9-b593-d223f7449a82
2023-11-02 14:55:56 +00:00
Sergey Biryukov
75008892aa Coding Standards: Correct equals sign alignment in various files.
This resolves a few WPCS warnings:
{{{
Equals sign not aligned with surrounding statements
}}}
so that the output of `composer format` is clean.

Follow-up to [56796], [56803], [56838], [56839], [56985].

See #59650.

git-svn-id: https://develop.svn.wordpress.org/trunk@57053 602fd350-edb4-49c9-b593-d223f7449a82
2023-11-02 00:02:36 +00:00
Jonathan Desrosiers
2e6a235812 Build/Test Tools: Increase the number of retries when restarting a workflow.
This increases the number of times to retry restarting a workflow from 10 to 15, and the `timeout-minutes` value to `30`.

For workflows with complex strategy matrix, the exponential backoff of 10 retries is still not enough to account for the GitHub Actions UI taking a long time to catch up.

Follow up to [56829] and [56830].
See #58867.

git-svn-id: https://develop.svn.wordpress.org/trunk@57052 602fd350-edb4-49c9-b593-d223f7449a82
2023-11-01 19:29:53 +00:00
Tonya Mork
126d780de9 Editor: 2nd update of npm packages for 6.4 RC3.
This second update for RC3 includes the following fixes:

* [https://github.com/WordPress/gutenberg/pull/55724 Update label for lightbox editor UI] - string change.
* [https://github.com/WordPress/gutenberg/pull/55720 Query: Require queryId for enhanced pagination to prevent PHP notices] and warnings.
* [https://github.com/WordPress/gutenberg/pull/55714 Query block enhanced pagination: Detect inner plugin blocks during render] - which avoids turning off enhanced pagination in TT4, includes string changes.
* [https://github.com/WordPress/gutenberg/pull/55309 Query Loop block: Reuse existing screen-reader-text CSS class for the enhanced pagination aria-live region].

Follow up to [57034], [56987], [56961], [56849], [56818], [56816].

Props afercia, aristath, artemiosans, czapla, darerodz, glendaviesnz, hellofromTonya, jameskoster, joen, luisherranz, mikachan, ocean90, peterwilsoncc, ramonopoly, rajinsharwar, swissspidy.
Fixes #59411.

git-svn-id: https://develop.svn.wordpress.org/trunk@57048 602fd350-edb4-49c9-b593-d223f7449a82
2023-11-01 17:46:03 +00:00
John Blackbourn
5333ea1f91 Docs: Correct some docblock formatting errors.
Fixes #59784

See #12009, #52710


git-svn-id: https://develop.svn.wordpress.org/trunk@57046 602fd350-edb4-49c9-b593-d223f7449a82
2023-11-01 15:08:10 +00:00
Tonya Mork
f6905ebced Taxonomy: Set "public" to "false" for user pattern categories.
Changes the `'wp_pattern_category'` taxonomy's `'public'` argument to `false`.

Follow-up to [56642].

Props vrajadas, glendaviesnz, hellofromTonya, ramonopoly.
Fixes #59569.

git-svn-id: https://develop.svn.wordpress.org/trunk@57044 602fd350-edb4-49c9-b593-d223f7449a82
2023-11-01 14:48:50 +00:00
Sergey Biryukov
01c842a25f Docs: Correct the type for optional parameters in a few media functions.
This affects the `$image_src` and/or `$image_meta` parameters in:
* `wp_get_attachment_image_srcset()`
* `wp_get_attachment_image_sizes()`
* `wp_calculate_image_sizes()`

Follow-up to [35412], [35419], [35481], [35498], [35569], [35672].

Props dilipbheda.
Fixes #59745.

git-svn-id: https://develop.svn.wordpress.org/trunk@57042 602fd350-edb4-49c9-b593-d223f7449a82
2023-11-01 11:49:31 +00:00
Bernie Reiter
f58f64587b Block Hooks: Allow traversal callbacks to modify parent block.
The callbacks returned by `make_before_block_visitor` and `make_after_block_visitor`, respectively, (which are passed as arguments to `traverse_and_serialize_block(s)`) currently accept three arguments, all of which are block arrays (i.e. with properties `blockName`, `attrs`, etc.):
- A ''reference'' to the block they're currently visiting, `&$block`;
- the block's `$parent_block`; and
- the `$prev`ious block (for `make_before_block_visitor`), or the `$next` block (for `make_after_block_visitor`), respectively.

Those arguments are passed to the "block visitor" callbacks by `traverse_and_serialize_block(s)` during traversal. The block that the callback is currently visiting is passed ''by reference'' to allow modifying it, which is e.g. used to inject the `theme` attribute into Template Part blocks.

One major limitation of Block Hooks is that they currently only work with templates, parts, and patterns that ''don't have any user modifications'' (i.e. that come straight from the corresponding theme files, rather than from the database). For WordPress 6.5, it is planned to change that to make Block Hooks work for templates, parts, and patterns that ''do'' have user modifications: #59646.

This will be implemented by storing an attribute on the "anchor" block. While working on that feature, it was found that the aforementioned callbacks will need to modify not only the currently visited `$block`, but also the `$parent_block` -- i.e. that the latter argument needs to be passed by reference as well. This is consistent with the requirement of adding an attribute to an anchor block, as it's not only the currently visited block that can serve as an anchor block (in the case of `before` or `after` sibling insertion), but also its parent (for `first_child` and `last_child` insertion).

If the `$parent_block` argument were to be changed to become a reference in a later WordPress version, this could be considered a backwards-compatibility breaking change. For this reason, this change is instead proposed for 6.4 already, which is the cycle during which the relevant functions were first introduced. This should have no impact on existing code, since nothing currently relies on `$parent_block` remaining unmodified by the respective callback, nor is anything currently modifying that argument.

Props hellofromTonya.
Fixes #59776.

git-svn-id: https://develop.svn.wordpress.org/trunk@57038 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-31 19:23:25 +00:00
Tonya Mork
c01bacad6b Twenty Twenty-Four: Bugfixes for 6.4 RC2.
This update includes the following bugfixes: 

- Fix: Added a new block pattern for the home template that inherits the page query and fits the design of the home page. (more context on the theme repo: https://github.com/WordPress/twentytwentyfour/pull/706)
- Fix: Rely on parent theme data for block style.
- Fix: Categories for some patterns.
- Fix: Minor labeling issues

Follow-up to [56999], [56951], [56813], [56764], [56716].

Props anlino, beafialho, desrosj, devmuhib, didierjm, fabiorubioglio, flixos90, hanneslsm, hellofromTonya, huzaifaalmesbah, ktaron, luminuu, mshowes, onemaggie, phillsav, poena, rajinsharwar, richtabor, shailu25.
Fixes #59770, #59759.

git-svn-id: https://develop.svn.wordpress.org/trunk@57036 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-31 17:24:38 +00:00
Tammie Lister
5dff9238b9 Update editor related npm packages for 6.4 RC3.
The npm packages needed update for 6.4 RC3.

Patch: https://github.com/WordPress/wordpress-develop/pull/5587.
This PR includes the following changes:

- Regression: [https://github.com/WordPress/gutenberg/pull/55553 Patterns: fix bug with authors and contributors not seeing user pattern categories].
- Bugfix: [https://github.com/WordPress/gutenberg/pull/55539 Query Loop:Disallow "enhanced pagination" with core blocks that may contain third-party blocks].
- Regression: [https://github.com/WordPress/gutenberg/pull/55667 File: Fix embedded PDF files in Safari].
- Regression: [https://github.com/WordPress/gutenberg/pull/55669 Ensure Term Description block is registered in core]

Props DAreRodz, luisherranz, poena, afercia, danieldudzic, hellofromtonya, siobhyb, mikachan, get_dave, scruffian, wildworks, glendaviesnz, ramonopoly, aaronrobertshaw.

See #59411.


git-svn-id: https://develop.svn.wordpress.org/trunk@57034 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-31 15:11:42 +00:00
Sergey Biryukov
db034446ac Coding Standards: Remove extra space in a comment in WP_REST_Blocks_Controller.
This fixes a WPCS error: `Whitespace found at end of line`.

Follow-up to [57032].

Props hellofromTonya.
See #59388.

git-svn-id: https://develop.svn.wordpress.org/trunk@57033 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-31 14:21:23 +00:00
Sergey Biryukov
3d86a763a6 Docs: Update some reusable block references to synced patterns.
In WordPress 6.3, [https://wordpress.org/documentation/article/reusable-blocks/ Reusable Blocks were renamed to Patterns]. A synced pattern will behave in exactly the same way as a reusable block.

This commit updates some references in DocBlocks and inline comments to use the new name.

Follow-up to [56030].

Props benjaminknox, oglekler, hellofromTonya, marybaum, nicolefurlan.
Fixes #59388.

git-svn-id: https://develop.svn.wordpress.org/trunk@57032 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-31 12:56:16 +00:00
Peter Wilson
17a01ed185 Options, Meta APIs: Fast follow fixes for option cache priming functions.
A collection of fixes for `wp_prime_option_caches()`:

* cache arrays and objects in their serialized form for consistency with `get_option()` and `wp_load_alloptions()`
* prevent repeat database queries for falsey and known non-existent options (notoptions)

Additional tests for `wp_prime_option_caches()` to ensure:

* additional database queries are not made repriming options (known, known-unknown and alloptions)
* cache is primed consistently
* `get_option()` returns a consistent value regardless of how it is primed
* database queries do not contain earlier primed options
* `get_option` does not prime the cache when testing the cache has been successfully primed

Fixes a test for `wp_prime_option_caches_by_group()` to ensure `get_option` does not prime the cache when testing the cache has been successfully primed.

Follow up to [56445],[56990],[57013].

Props peterwilsoncc, costdev, flixos90, hellofromTonya, mikeschroder, joemcgill.
Fixes #59738. See #58962.


git-svn-id: https://develop.svn.wordpress.org/trunk@57029 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-30 22:56:25 +00:00
Sergey Biryukov
63a4ae98ee Editor: Correctly load RTL stylesheets in register_core_block_style_handles().
When setting an RTL language under Settings → General, some RTL stylesheets were not loaded, with LTR stylesheets being loaded instead, meaning that some blocks were not displayed correctly.

This commit ensures that all appropriate RTL stylesheets are loaded when selecting an RTL language.

Follow-up to [56524].

Props mukesh27, maahrokh, hellofromTonya, joemcgill, huzaifaalmesbah, rajinsharwar, devmuhib, swissspidy.
Fixes #59715.

git-svn-id: https://develop.svn.wordpress.org/trunk@57028 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-30 12:52:44 +00:00
Sergey Biryukov
ffcf5fb38a Docs: Improve documentation for wp_tempnam() and download_url().
Instead of mentioning the `unlink()` function specifically, the DocBlock should state that the calling function must delete or move the temporary file.

Follow-up to [6779], [12151].

Props bedas.
Fixes #59761.

git-svn-id: https://develop.svn.wordpress.org/trunk@57027 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-29 00:14:46 +00:00
Sergey Biryukov
cc2133fc34 Blocks: Parse the arguments earlier in register_block_type_from_metadata().
This makes it possible to register a block by passing an array of arguments, without the presence of a `block.json` file.

Follow-up to [48141], [49948].

Props aristath, spacedmonkey, mukesh27, costdev, audrasjb, oglekler, felipeelia, hellofromTonya.
Fixes #56865.

git-svn-id: https://develop.svn.wordpress.org/trunk@57026 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-28 01:00:14 +00:00
Joe Dolson
d571da5db5 Plugins: Prevent ajaxComplete listener from observing all events.
Add a conditional to prevent the `prefers-reduced-motion` `ajaxComplete` listener from observing events not occurring in the plugin installation screen. Improve handling of settings data test.

The listener observing `ajaxComplete` in [56541] was intercepting all `ajaxComplete` events, creating potential for unexpected errors in unrelated functions.

Props bplv, afercia, rudlinkon, hellofromTonya, huzaifaalmesbah, joedolson, jorbin.
Fixes #59689.

git-svn-id: https://develop.svn.wordpress.org/trunk@57022 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-27 19:23:07 +00:00
Joe McGill
ea30b5d8eb Upgrade/Install: Skip registering theme block patterns during the upgrade process.
This fixes a bug during the database upgrade process where a theme's `functions.php` file may not be loaded, leading to potential exceptions if the theme's pattern files use symbols (classes, functions, constants, etc.) that are declared only when the `functions.php` file is loaded. To do so, a check for `wp_get_active_and_valid_themes()` is added early to `_register_theme_block_patterns()`, which returns early if no active or valid themes are returned.

Props fabiankaegy, rajinsharwar, pbiron, huzaifaalmesbah, hellofromTonya, peterwilsoncc, joemcgill.
Fixes #59723.


git-svn-id: https://develop.svn.wordpress.org/trunk@57021 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-27 19:02:54 +00:00
Felix Arntz
22e32d8993 Themes: Skip wrapping block template for singular content with a main query loop when the template was injected from outside the current theme.
As a follow up to [56507], this fixes a bug that could occur for instance when plugins hijack the block template detection process to inject their own block template with entirely custom logic.

Props afragen, hellofromTonya, costdev, mukesh27, huzaifaalmesbah, flixos90.
Fixes #59736.
See #58154.


git-svn-id: https://develop.svn.wordpress.org/trunk@57019 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-27 18:16:05 +00:00
Aaron Jorbin
f6befb782e Help/About: Improve Accessibility, RTL, Internationalization, and Responsiveness of about pages.
Tweaks the 6.4 about pages in a couple of ways:
 - Decouples the background from the 6.4 logo so the logo can move for RTL.
 - Updates a color to improve color contrast.
 - Help prevent overlap of long text strings with 6.4 logo.
 - Ensure background isn't dark when no background is used on mobile.

Props nudge, jorbin, afercia, sumitsingh, sabernhardt.
See #59289, #59664.



git-svn-id: https://develop.svn.wordpress.org/trunk@57018 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-27 17:01:50 +00:00
Sergey Biryukov
dea705e71f Coding Standards: Remove a redundant section in the phpcs.xml.dist ruleset.
The affected lines already have ignore annotations in the `wp-includes/class-wp-block-parser-block.php` file itself.

Follow-up to [56048], [56738], [56743], [56751], [56752], [56753].

Props jrf, SergeyBiryukov.
See #59161.

git-svn-id: https://develop.svn.wordpress.org/trunk@57017 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-27 08:27:33 +00:00
Peter Wilson
fc3aae3a08 Options, Meta APIs: Rename option cache priming functions.
Rename the option cache priming functions to more closely follow the naming convention used by other cache priming functions.

* `wp_load_options()` becomes `wp_prime_option_caches()`
* `wp_load_options_by_group()` becomes `wp_prime_option_caches_by_group()`

The unit test files and classes are renamed accordingly.

Unlike the existing cache priming functions, these functions were introduced with the intention of being public so use the `wp_` prefix rather than the `_` prefix used by the functions initially introduced as private functions but since made public.

Follow up to [56445],[56990].

Props flixos90, peterwilsoncc, joemcgill, SergeyBiryukov, desrosj.
Fixes #58962.



git-svn-id: https://develop.svn.wordpress.org/trunk@57013 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-26 22:54:15 +00:00
Aaron Jorbin
2fb54c20cd REST API: Move rest_pre_serve_request filter to after no cache headers are sent.
[56834] adjusted the order of activity inside the rest server responses. This lead to the `rest_pre_serve_request` filter potentially blocking the sending of the no cache headers. This moves that action back to being after the sending of no cache headers has finished to restore the pre 6.3.2 order of these two actions.

Props perrelet, SergeyBiryukov, peterwilsoncc.
Fixes #59722.


git-svn-id: https://develop.svn.wordpress.org/trunk@57012 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-26 22:34:41 +00:00
Sergey Biryukov
64b1726c44 Tests: Use a @requires annotation for readonly() function test.
The function is only defined by WordPress core on PHP < 8.1.

Follow-up to [51586].

See #59647.

git-svn-id: https://develop.svn.wordpress.org/trunk@57011 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-26 20:31:45 +00:00
Felix Arntz
33069c3c6b Themes: Fix block theme supports being added too early, leading to Customizer live preview bugs in 6.4.
The Customizer live preview broke because of [56635], however the root cause for the bug was a lower-level problem that had been present since WordPress 5.8: The block theme specific functions `_add_default_theme_supports()` and `wp_enable_block_templates()` were being hooked into the `setup_theme` action, which fires too early to initialize theme features. Because of that, theme functionality would be initialized before the current theme setup being completed. In the case of the Customizer, that includes overriding which theme is the current theme entirely, thus leading to an inconsistent experience.

This changeset fixes the bug by moving those two callbacks to the `after_setup_theme` action, which is the appropriate action to initialize theme features.

Props karl94, hellofromTonya, joemcgill, flixos90.
Fixes #59732.
See #18298, #53397, #54597.


git-svn-id: https://develop.svn.wordpress.org/trunk@57009 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-26 18:42:46 +00:00
Sergey Biryukov
0133fc5441 Tests: Remove some unnecessary multisite test skipping.
These checks are redundant, as the skipping already handled by the `ms-required` and `ms-excluded` groups.

Follow-up to [36740], [36741], [38705], [40520], [51415].

Props johnbillion.
See #59647.

git-svn-id: https://develop.svn.wordpress.org/trunk@57008 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-25 11:20:23 +00:00
Jonathan Desrosiers
32f75bf0f4 Twenty Twenty-Four: Include file renaming for RC2.
This includes a file renaming that was missed in [56999].

Follow-up to [56999], [56951], [56813], [56764], [56716].

Props hellofromTonya, huzaifaalmesbah.
See #59711.

git-svn-id: https://develop.svn.wordpress.org/trunk@57003 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-24 14:33:23 +00:00
Jonathan Desrosiers
9b539b65bf Twenty Twenty-Four: Bug fixes for 6.4 RC2.
This update includes updates to patterns to correct color issues and some code quality fixes.

Follow-up to [56951], [56813], [56764], [56716].

Props luminuu, richtabor, onemaggie, kafleg, swissspidy, huzaifaalmesbah, neilorangepeel, shailu25, lada7042, mukesh27, nilovelez, jorbin.
Fixes #59711.

git-svn-id: https://develop.svn.wordpress.org/trunk@56999 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-24 14:04:13 +00:00
Sergey Biryukov
c438bebad1 Tests: Correct the WP_Test_Stream::mkdir() method.
The method attempted to check if there is already a file with the same name, however the conditional used an undefined variable.

This commit prevents directory creation if a file or directory with the same name already exists, bringing consistency with the PHP `mkdir()` implementation.

Includes adding missing documentation for the method.

Reference: [https://www.php.net/manual/en/streamwrapper.mkdir.php PHP Manual: streamWrapper::mkdir()].

Follow-up to [49230].

Props david.binda, sadizaman, rajinsharwar, SergeyBiryukov.
Fixes #59406.

git-svn-id: https://develop.svn.wordpress.org/trunk@56998 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-24 11:32:42 +00:00
Tonya Mork
88ab0a2c57 Tests: Fix static property handling in r56991.
Fixes static property handling for `WP_Duotone::$block_css_declarations` in the `Tests_Block_Supports_Duotone::test_css_declarations_are_generated_even_with_empty_block_content()`:

* Fixes `ReflectionProperty::setValue()` to use an instance of `WP_Duotone`.
* Adds an inline comment to explain why a static class (i.e. a class that is not intended to be an object by design as it only contains static properties and methods) needs an instance, i.e. needed for PHP 8.3 and higher.
* Resets the static property's value to its original value, i.e. before the test started.

Follow-up to [56991].

Props costdev.
See #59694.

git-svn-id: https://develop.svn.wordpress.org/trunk@56996 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-24 10:57:03 +00:00
Bernie Reiter
ac8bca4fdf Blocks: Fix layout support to be compatible with enhanced pagination.
Make layout support compatible with enhanced pagination by ensuring that generated class names are stable across pagination, even when the number of rendered posts is different.

With the previous implementation of enhanced pagination, the CSS corresponding to each block was not detected. Therefore, for enhanced pagination to work correctly, the CSS of the blocks present in the Post Template must be stable on all pages.

The number of posts rendered by the Query block is always the same, except in the last page, where it can be only a fraction. If any of the blocks rendered by the Post Template used the `wp_unique_id` function, the ID (which is incremental) would have been different than in the previous pages and the class names would have varied.

This is remediated by this changeset by replacing the usage of `wp_unique_id` in the layout support (which is used by the Query block) with an implementation that uses IDs that are incremental only for that block. That way, the generated class names are never affected by the number of times `wp_unique_id` runs.

Props luisherranz, andrewserong, isabel_brison, costdev, mukesh27, cbravobernal, hellofromTonya, jorbin.
Fixes #59681.

git-svn-id: https://develop.svn.wordpress.org/trunk@56994 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-24 08:49:38 +00:00
Peter Wilson
b5392cc28c Build/Test tools: Introduce partial unit tests for WP_Upgrader.
Props jipmoors, karlijnbk, chaion07, cu121, martin.krcho, costdev, mukesh27, hellofromTonya, SergeyBiryukov, audrasjb, jrf.
Fixes #54245.



git-svn-id: https://develop.svn.wordpress.org/trunk@56992 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-24 01:38:16 +00:00
Tonya Mork
ee631556b4 Editor: Fix render_duotone_support() to be compatible with enhanced pagination.
Some blocks do not have content. For duotone support, blocks without content still need to run through the `render_duotone_support()` to render their duotone CSS.

This fix makes the duotone compatible with the enhanced pagination (introduced in 6.4.0) by making sure that the CSS is always on the page, even when the posts have no featured image. It also prevents the duotone from interfering with other blocks using `wp_unique_id()`.


References:
* [https://github.com/WordPress/gutenberg/pull/55415 Gutenberg PR 55415]

Follow-up to [56226].

Props cbravobernal, luisherranz, hellofromTonya, isabel_brison, jorbin.
Fixes #59694.

git-svn-id: https://develop.svn.wordpress.org/trunk@56991 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-23 23:37:55 +00:00
Felix Arntz
51ae4e67d0 Options, Meta APIs: Rename prime_options() to wp_load_options().
This clearly separates these functions which are intended to be used by external developers from the existing `_prime_*_caches()` functions which are primarily intended for internal usage. The term "load" is additionally more accessible than "prime".

This changeset renames the above function, as well as the wrapper function `prime_options_by_group()` to `wp_load_options_by_group()`.

Props peterwilsoncc, joemcgill, hellofromTonya, poran766, flixos90.
Fixes #58962.


git-svn-id: https://develop.svn.wordpress.org/trunk@56990 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-23 21:27:31 +00:00
Tammie Lister
ce342f1a33 Update editor related npm packages for 6.4 RC2.
The npm packages needed update for 6.4 RC2.

Props siobhyb, cbravobernal, DAreRodz, luisherranz, artemiosans, afercia, jameskoster, czapla, alexstine, SantosGuillamot, ramonopoly, isabel_brison, andrewserong, jeryj, joedolson

See #59411.


git-svn-id: https://develop.svn.wordpress.org/trunk@56987 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-23 17:05:29 +00:00