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
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
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
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
When the XML sitemaps feature was originally introduced, the `lastmod` field was omitted because guidance at the time indicated it was less important for search engines, plus for some entities it was computationally expensive to add. Now that the guidance has slightly changed, we are revisiting this and adding `lastmod` where easily possible.
- Adds `lastmod` to all individual post objects (of any post type) in the sitemap
- Adds `lastmod` to the homepage sitemap entry if the homepage is set to display the latest posts.
No `lastmod` is added for the individual sitemap pages in the sitemap index, nor for term archives or user archives. Those enhancements require additional changes, such as storing the modified date for a taxonomy term when something is added to that term. They can be revisited in separate follow-up tickets.
Props swissspidy, joemcgill.
Fixes#52099
git-svn-id: https://develop.svn.wordpress.org/trunk@56985 602fd350-edb4-49c9-b593-d223f7449a82
Includes:
* Correcting the position of `@since 6.4.0` in a few places.
* Adding missing `@return` documentation.
* Adjusting parameter spacing.
Follow-up to [56714].
Props jeremyfelt, mukesh27.
Fixes#59666.
git-svn-id: https://develop.svn.wordpress.org/trunk@56984 602fd350-edb4-49c9-b593-d223f7449a82
With the migration of visual regression tests to Playwright in [56926], this package is no longer needed and can be safely removed.
See #59517.
git-svn-id: https://develop.svn.wordpress.org/trunk@56980 602fd350-edb4-49c9-b593-d223f7449a82
In [56765], theme block pattern files were cached to a transient as a performance enhancement. However, transients are not easily clearable when caches are flushed on environments not using a persistent cache, which can lead to errors if the theme files are renamed, edited, or moved.
This changes the caching mechanism to use `wp_cache_set()` instead, and caches these values to the global group so they are still persistent on environments using an object cache, and will be cleared by a cache flush.
In addition, the helper `_wp_get_block_patterns` has been moved `WP_Theme::get_block_patterns` for consistency with other block related theme methods and cache helpers for these values, `WP_Theme::get_pattern_cache` and `WP_Theme::set_pattern_cache`, have been made private.
Relevant unit tests updated.
Props: afercia, flixos90, mukesh27, joemcgill.
Fixes#59633. See #59591, #59490.
git-svn-id: https://develop.svn.wordpress.org/trunk@56978 602fd350-edb4-49c9-b593-d223f7449a82
A very common contributor setup is having a copy of the `gutenberg` development repository within a checkout of the `wordpress-develop` repository. On occasion, there are some strange incompatibilities that come up when using this setup. A few examples can be seen in #58671 and #59634.
This changeset helps ensure that these edge cases are not introduced by testing the Gutenberg plugin’s build process within WordPress configured to run from both the `src` and `build` directories.
This also renames the “Test npm” workflow to a more general “Test Build Processes”, which more accurately describes what is actually being tested within it and allows these new test jobs to be grouped in.
And finally, the logic within the workflow has been split out into two callable workflows. This helps avoid code duplication within the workflow, and allows for better grouping on the workflow run screen.
Props swissspidy, aferica, SergeyBiryukov, antonvlasenko, desrosj.
Fixes#59632. See #58671, #59634.
git-svn-id: https://develop.svn.wordpress.org/trunk@56976 602fd350-edb4-49c9-b593-d223f7449a82
The globals introduced in [56635] to cache the current theme directories in memory were not considering switching sites in a multisite network. This changeset addresses the bug including test coverage.
Props codex-m, jeremyfelt.
Fixes#59677.
See #18298.
git-svn-id: https://develop.svn.wordpress.org/trunk@56974 602fd350-edb4-49c9-b593-d223f7449a82
This adds the `PUPPETEER_SKIP_DOWNLOAD` environment variable to the Build WordPress workflow to skip downloading Puppeteer browser binaries unnecessarily.
Follow up to [56958].
See #59416, #59517, #58863.
git-svn-id: https://develop.svn.wordpress.org/trunk@56973 602fd350-edb4-49c9-b593-d223f7449a82
When a branch is created, there is no previous commit to reference in the `github.event.before` context, which causes the performance workflow to fail because there is no previous commit to perform a comparison with.
This adds a condition to check that `github.event.before` is not set to `0000000000000000000000000000000000000000`, which is the default value when there are no previous commits.
Props swissspidy.
See #588867.
git-svn-id: https://develop.svn.wordpress.org/trunk@56972 602fd350-edb4-49c9-b593-d223f7449a82
Includes removing `.php` from some older group names, because most of the groups are no longer named based on the file containing the function, and sometimes functions move around, making the file-based group name inaccurate.
Props afercia, aristath, poena, SergeyBiryukov.
See #59647.
git-svn-id: https://develop.svn.wordpress.org/trunk@56971 602fd350-edb4-49c9-b593-d223f7449a82
Both the `$pre_callback` and `$post_callback` functions that are given as arguments to `traverse_and_serialize_block(s)` receive a reference to the current block as their first argument. However, while any changes that the "pre" callback makes to the block are reflected by the serialized markup, the same wasn't true for the "post" callback: Any changes that it made were only applied ''after'' the block had already been serialized.
This commit changes the behavior such that `$post_callback`'s changes to the current block are also reflected in the serialized markup.
See #59646.
Props gziolo.
Fixes#59669.
git-svn-id: https://develop.svn.wordpress.org/trunk@56970 602fd350-edb4-49c9-b593-d223f7449a82
Each of these functions already has a separate test for availability.
If any of them are unavailable, then the test should fail rather than be skipped.
Follow-up to [52038], [52039], [52040].
Props johnbillion.
See #59647.
git-svn-id: https://develop.svn.wordpress.org/trunk@56969 602fd350-edb4-49c9-b593-d223f7449a82
After [56966], CI jobs that check the `package-lock.json` failed on the "Ensure version-controlled files are not modified or deleted" task.
There are 2 version fields that need to be updated for the new WP version. This changeset updates the "packages" > "version" for 6.5.0.
Follow-up to [56966].
Props swissspidy, benharri.
Unprops hellofromTonya.
Fixes#59665.
git-svn-id: https://develop.svn.wordpress.org/trunk@56968 602fd350-edb4-49c9-b593-d223f7449a82
Fixes the version number from [56966] to include its number in the version, as it is the commit that opened trunk for 6.5-alpha.
Follow-up to [56966].
git-svn-id: https://develop.svn.wordpress.org/trunk@56967 602fd350-edb4-49c9-b593-d223f7449a82
Capitalize RC in the version, i.e. just in case the build requires it.
Unprops hellofromTonya.
git-svn-id: https://develop.svn.wordpress.org/trunk@56963 602fd350-edb4-49c9-b593-d223f7449a82
It was found that Template Part blocks were broken in the Site Editor, showing the `Template part has been deleted or is unavailable` message, due to a missing `theme` attribute.
This bug seems to have been introduced by [56896], whose goal was to only inject that attribute into the markup returned by the templates and patterns REST API endpoints but not on the frontend, in order to improve performance. It has been demonstrated locally that reverting that changeset fixes the bug.
Reverts [56896].
Props mmcalister, swisspidy, thelovelist, hellofromTonya, pbiron, Pauthake015, richtabor, nicolefurlan, huzaifaalmesbah, annezazu, kafleg, aegkr, sunitarai, shresthaaman, andraganescu, onemaggie, gziolo.
Fixes#59629.
git-svn-id: https://develop.svn.wordpress.org/trunk@56960 602fd350-edb4-49c9-b593-d223f7449a82
Reverts [56451] to avoid the following issues:
* missing the default `font-size` for anyone who does not use the size control.
* unintentional reduction in citation's `line-height` down to the `--pullquote--line-height` value (1.3 instead of 1.6).
With 6.4 RC1 happening shortly, this revert is necessary to avoid shipping this issues in the release, while giving the time needed to resolve in the next cycle.
Follow-up to [56451].
Props sabernhardt, nicolefurlan.
See #57854.
git-svn-id: https://develop.svn.wordpress.org/trunk@56959 602fd350-edb4-49c9-b593-d223f7449a82
Storing build files enables reusing them in WordPress Playground and ultimately implementing a Pull Request.
Props desrosj, bernhard-reiter
See #59416.
git-svn-id: https://develop.svn.wordpress.org/trunk@56958 602fd350-edb4-49c9-b593-d223f7449a82
This updates the following development dependencies to their latest versions:
- `postcss`
- `qunit`
- `sass`
- `webpack`
Additionally, `npm audit fix` has been run.
Fixes#58863.
git-svn-id: https://develop.svn.wordpress.org/trunk@56957 602fd350-edb4-49c9-b593-d223f7449a82
This adds a global environment variable to the Test old branches workflow to make the supported version more clear and easier to update in the future. This will also make it easier to reference in more places as this workflow grows.
See #58867.
git-svn-id: https://develop.svn.wordpress.org/trunk@56955 602fd350-edb4-49c9-b593-d223f7449a82
The `PUPPETEER_SKIP_DOWNLOAD` environment variable is used to prevent Puppeteer from automatically downloading browser binaries.
It was removed in [56926] due to the migration to Playwright. However, because of the QUnit tests, Puppeteer is actually still a dependency.
Until those tests change, we have to keep this environment variable to prevent unnecessary downloads on CI.
Props SergeyBiryukov.
Fixes#59517.
git-svn-id: https://develop.svn.wordpress.org/trunk@56954 602fd350-edb4-49c9-b593-d223f7449a82
When applying updates to HTML, one step was left out in [56941] which updated the position of the end of the current tag. This made it possible to create bookmarks with null or earlier end positions than their start position. This in turn broke the Directive Processor in Gutenberg during the backport of changes from Core into Gutenberg.
In this commit, after applying updates, the HTML document is now scanned fully to the end of the current tag, updating the internal pointer to its end, so that nothing else will be broken or misaligned.
Follow-up to [56941].
Props dmsnell.
Fixes#59643.
git-svn-id: https://develop.svn.wordpress.org/trunk@56953 602fd350-edb4-49c9-b593-d223f7449a82
The required version was previously set to two different values:
* 4.7 in the theme's `functions.php` file.
* 4.9.6 in theme headers, because of the `the_privacy_policy_link()` function usage in `footer.php`.
However, as `the_privacy_policy_link()` call is wrapped in a `function_exists()` check, it does not affect the requirements in practice.
This commit aims to correct the discrepancy by updating theme headers to match the actual required WP version.
Follow-up to [43808], [43892].
Props poena, kafleg, felipeelia, audrasjb, huzaifaalmesbah, shailu25, nicolefurlan, oglekler.
Fixes#59557.
git-svn-id: https://develop.svn.wordpress.org/trunk@56952 602fd350-edb4-49c9-b593-d223f7449a82
Resyncing changes for TT4 into Core.
Changes include:
* Reformatted all the patterns for readability.
* Bugfixes in the markup and improvements on the string translation functions.
* Renaming of some patterns, making them consistent with the content they show and whether they are simple patterns, full-page patterns or patterns meant to replace templates.
Follow-up to [56813], [56764], [56716].
Props richtabor, onemaggie, luminuu, shailu25, dunhakdis, shivashankerbhatta, dajeema, enodekciw, kafleg, viralsampat, glendaviesnz, beafialho, webmandesign, huzaifaalmesbah, gregfuller, benharri.
Fixes#59640.
git-svn-id: https://develop.svn.wordpress.org/trunk@56951 602fd350-edb4-49c9-b593-d223f7449a82
Also includes updates to the contribute, credits, freedom and privacy pages.
Props luminuu, rmartinezduque, estelaris, jorbin, mukesh27, cbringmann, richtabor, annezazu, nudge, ohia, acirujano, elmastudio, cathibosco1, sereedmedia, markoserb, joen. (Also someone named Allison who I am going to guess is Taylor Alison Swift but has no avatar so I will never know)
git-svn-id: https://develop.svn.wordpress.org/trunk@56950 602fd350-edb4-49c9-b593-d223f7449a82
Prevent the saving of invalid timezone string in to the database on the options pages. If an invalid timezone is submitted it is ignored and the setting remains unchanged.
This prevents a warning or fatal (depending on the PHP version) from being thrown by an invalid timezone setting on the Settings > General page.
Props ankit-k-gupta, costdev, huzaifaalmesbah, mrinal013, nicolefurlan, oglekler.
Fixes#58814.
git-svn-id: https://develop.svn.wordpress.org/trunk@56949 602fd350-edb4-49c9-b593-d223f7449a82
This reverts changes from [56648], [56681], [56717], [56762], [56788], [56797], and [56814] to restore the behavior for `update_option()` and `update_network_option()` to their prior state as of 6.3.X due to the discovery of various backwards compatibility issues found late in the 6.4 release cycle.
Props mukesh27, costdev, flixos90, spacedmonkey, snicco, jrf, joemcgill.
See #22192, #59360.
git-svn-id: https://develop.svn.wordpress.org/trunk@56946 602fd350-edb4-49c9-b593-d223f7449a82
The npm packages needed a second part to the update for 6.4 RC1.
Props isabel_brison, andrewserong, jsnajdr, wildworks, joen, mciampini, tyxla, youknowriad, ramonopoly, spacedmonkey, dmsnell, mikachan, kishanjasani, czapla, siobhyb, darerodz, luisherranz
See #59411.
git-svn-id: https://develop.svn.wordpress.org/trunk@56945 602fd350-edb4-49c9-b593-d223f7449a82
`grunt-contrib-qunit` was upgraded from version `7.0.1` to `8.0.1` in [56647]. However, this update causes a strange failure when running the build script for the Gutenberg plugin when checked out within a `wordpress-develop` checkout.
This reverts the related change in [56647] and downgrades the dependency back to `7.0.1` until the exact reason for the failure is narrowed down.
Props afercia, kevin940726, antonvlasenko, desrosj.
See #59634, #58863.
git-svn-id: https://develop.svn.wordpress.org/trunk@56944 602fd350-edb4-49c9-b593-d223f7449a82
Such `@return void` annotations must not be used in WordPress core's PHP code, except bundled themes, third-party libraries, and PHP compatibility shims.
Props isabel_brison, swissspidy.
Fixes#59619.
git-svn-id: https://develop.svn.wordpress.org/trunk@56943 602fd350-edb4-49c9-b593-d223f7449a82
This is a follow-up to [56926], where this logic has been reintroduced after it was originally removed in [56198].
Props desrosj.
See #59517.
git-svn-id: https://develop.svn.wordpress.org/trunk@56942 602fd350-edb4-49c9-b593-d223f7449a82
After modifying tags in the HTML API, the Tag Processor backs up to before the tag being modified and then re-parses its attributes. This saves on the code complexity involved in applying updates, which have already been transformed to “lexical updates” by the time they are applied.
In order to do that, `::get_updated_html()` called `::next_tag()` to reuse its logic. However, as a public method, subclasses may change the behavior of that method, and the HTML Processor does just this. It maintains an HTML stack of open elements and when the Tag Processor calls this method to re-scan a tag and its attributes, it leads to a broken stack.
This commit replaces the call to `::next_tag()` with a more appropriate reapplication of its internal parsing logic to rescan the tag name and its attributes. Given the limited nature of what's occurring in `::get_updated_html()`, this should bring with it certain guarantees that no HTML structure is being changed (that structure will only be changed by subclasses like the HTML Processor).
Follow-up to [56274], [56702].
Props dmsnell, zieladam, nicolefurlan.
Fixes#59607.
git-svn-id: https://develop.svn.wordpress.org/trunk@56941 602fd350-edb4-49c9-b593-d223f7449a82
Within the details block, style the `summary` element using the default display, `list-item`, this ensures the toggle icon appears indicating the summary can be expanded or contracted.
Props ankit-k-gupta, nicolefurlan, poena, sabernhardt.
Fixes#58915.
git-svn-id: https://develop.svn.wordpress.org/trunk@56940 602fd350-edb4-49c9-b593-d223f7449a82