After [56958], pull requests to `wordpress-develop` can be tested within a WordPress Playground instance. However this capability is not obvious.
This makes several updates to GitHub action workflows to avoid unnecessary extra runs/jobs while also commenting on pull requests with proper context for testing in Playground once a build is available for the PR.
Changes:
- The `build.yml` workflow has been deleted. The WordPress build process is already being tested within the `test-build-processes.yml` workflow. Now that workflow will produce and upload the built artifact for the given PR.
- A `pull-request-comments.yml` workflow has been added to handle the commenting. To avoid having multiple workflows that comment on PRs, the logic within the `welcome-new-contributors.yml` workflow has been merged into this one.
- The `pull_request` event trigger lacks the needed permission to comment on or update pull requests. Instead of using `pull_request_target` to navigate around this, the `test-build-processes.yml` workflow will now use `workflow_dispatch` to initiate a run of the commenting workflow. This adds the ability to only comment on the PR when a build has been successfully created and uploaded as an artifact.
Props swissspidy, zieladam, jeffpaul.
See #59416.
Built from https://develop.svn.wordpress.org/trunk@57124
git-svn-id: http://core.svn.wordpress.org/trunk@56635 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This aims to:
* Perform the checks as early as possible to avoid redundant function calls.
* Remove an empty conditiaonal branch and make the exit conditions clearer.
* Bring the formatting in line with other multi-line conditionals in core.
Follow-up to [56836].
See #59650.
Built from https://develop.svn.wordpress.org/trunk@57123
git-svn-id: http://core.svn.wordpress.org/trunk@56634 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In preparation for updating Core to use Node.js version 18.x, this updates the dependancies for the Twenty Twenty-One theme to the latest versions. This addresses an unsupported engine warning where packages within the dependency tree did not support Node.js > 16.x.
All changes to built files are included in this commit. These changes are a result of the following:
- Identical sets of properties for multiple selectors are now consolidated into one.
- The removal of a duplicate `--branding--description--font-family` definition.
- The addition of the `postcss-discard-empty` dependency, which removes empty CSS rules within IE stylesheets after the previous consolidation is performed.
- `stylelint` has only been updated to 14.x (15.x is the latest). This is because `@wordpres/stylelint-config` currently has a version constraint of `^14.2` and does not properly support 15.x.
The last change of note is the new configuration for the `value-keyword-case` rule in `.stylelint-css.json`. This was added as a way to prevent the `currentColor` from being changed to all lowercase.
Props jorbin, poena.
See #59663, #59658.
Built from https://develop.svn.wordpress.org/trunk@57122
git-svn-id: http://core.svn.wordpress.org/trunk@56633 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The recently introduced Block Hooks API exposes a filter (`hooked_block_types`) which is given a `$context` argument, among others. If the filter is called on a block that's part of a template or template part, `$context` is set to the corresponding `WP_Block_Template` object.
However, that object's `$content` property is currently ''not'' exposed to the filter. This changeset amends that shortcoming.
This is useful for callbacks that might want to detect the presence of a serialized block instance (or potentially in the future utilize the HTML API) to restrict where the block is injected (before the template is rendered).
Addressing this also achieves parity with the structure of `$context` when it represents a pattern (where pattern serialized content is present).
Props nerrad.
Fixes#59882.
Built from https://develop.svn.wordpress.org/trunk@57118
git-svn-id: http://core.svn.wordpress.org/trunk@56629 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The example code in the PHPDoc comment for the HTML Tag Processor class
previously showed calling `next_tag()` with an array containing a `class`
key, which should have been `class_name`. This patch fixes this by using
the appropriate `class_name` key.
Props dmsnell, gaambo, crstauf, atachibana, audrasjb, krupalpanchal.
Fixes#59891.
Built from https://develop.svn.wordpress.org/trunk@57116
git-svn-id: http://core.svn.wordpress.org/trunk@56627 1a063a9b-81f0-0310-95a4-ce76da25c4cd
There are a handful of elements which behave similarly and are generically container elements. These are the following elements:
ADDRESS, ARTICLE, ASIDE, BLOCKQUOTE, CENTER, DETAILS, DIALOG, DIR,
DL, DIV, FIELDSET, FIGCAPTION, FIGURE, FOOTER, HEADER, HGROUP, MAIN,
MENU, NAV, SEARCH, SECTION, SUMMARY
This patch adds support to the HTML Processor for handling these elements. They do not require any additional logic in the rest of the class, and carry no specific semantic rules for parsing beyond what is listed in their group in the IN BODY section of the HTML5 specification.
Props dmsnell.
Fixes#59914.
Built from https://develop.svn.wordpress.org/trunk@57115
git-svn-id: http://core.svn.wordpress.org/trunk@56626 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Most of the `tabindex` attributes across the admin were removed in [21311].
This commit updates the example for the `$other_attributes` parameter to use the `id` attribute instead.
Includes synchronizing documentation between `submit_button()` and `get_submit_button()`.
Follow-up to [15810], [16061], [21311], [27136], [31599].
Props benjaminknox, sabernhardt, fushar, SergeyBiryukov.
Fixes#59768.
Built from https://develop.svn.wordpress.org/trunk@57114
git-svn-id: http://core.svn.wordpress.org/trunk@56625 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This updates the '@since 6.4.0' annotation in `_register_theme_block_patterns` to reference `WP_Theme::get_block_patterns` instead of `_wp_get_block_patterns`, which was changed in [56978].
Props audrasjb, mukesh27, joemcgill.
Fixes#59869.
Built from https://develop.svn.wordpress.org/trunk@57102
git-svn-id: http://core.svn.wordpress.org/trunk@56613 1a063a9b-81f0-0310-95a4-ce76da25c4cd
During a bulk edit of posts with different categories, the categories for the edited posts would be reset to the default category: uncategorized by default.
This reverts [56712] to resolve the issue.
Props peterwilsoncc, hellofromtonya, jorbin.
Fixes#59837.
See #11302.
Built from https://develop.svn.wordpress.org/trunk@57093
git-svn-id: http://core.svn.wordpress.org/trunk@56604 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Partial revert of [56475] to reinstate the private `wpdb::$use_mysqli` property and set to its default to `true`. This private property was / is accessible through the magic methods. Though Core's usage of this property was removed by [56475], plugins are using the property. Reinstating it resolves the BC break.
Follow up to [56475].
Props jason_the_adams, joemcgill, johnbillion, johnjamesjacoby, jrf, rajinsharwar, renehermi.
Fixes#59846.
Built from https://develop.svn.wordpress.org/trunk@57089
git-svn-id: http://core.svn.wordpress.org/trunk@56600 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This updates the Requests library from version `2.0.8` to `2.0.9`. This is a hotfix release.
Props jorbin, hellofromTonya, desrosj, barry, cenkdemir, nexflaszlo, schlessera, jrf, Clorith, tomsommer, azaozz, pbiron, afragen, howdy_mcgee.
Fixes#59842.
Built from https://develop.svn.wordpress.org/trunk@57086
git-svn-id: http://core.svn.wordpress.org/trunk@56597 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This corrects the order the arguments are passed to the `contains()` function in the Performance Testing workflow.
Because the arguments were passed incorrectly, the expression was not evaluating correctly.
Follow up to [56972].
Props hellofromTonya.
See #59805.
Built from https://develop.svn.wordpress.org/trunk@57085
git-svn-id: http://core.svn.wordpress.org/trunk@56596 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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.
Built from https://develop.svn.wordpress.org/trunk@57068
git-svn-id: http://core.svn.wordpress.org/trunk@56579 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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.
Built from https://develop.svn.wordpress.org/trunk@57066
git-svn-id: http://core.svn.wordpress.org/trunk@56577 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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.
Built from https://develop.svn.wordpress.org/trunk@57063
git-svn-id: http://core.svn.wordpress.org/trunk@56574 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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.
Built from https://develop.svn.wordpress.org/trunk@57061
git-svn-id: http://core.svn.wordpress.org/trunk@56572 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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.
Built from https://develop.svn.wordpress.org/trunk@57056
git-svn-id: http://core.svn.wordpress.org/trunk@56567 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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.
Built from https://develop.svn.wordpress.org/trunk@57052
git-svn-id: http://core.svn.wordpress.org/trunk@56563 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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.
Built from https://develop.svn.wordpress.org/trunk@57038
git-svn-id: http://core.svn.wordpress.org/trunk@56549 1a063a9b-81f0-0310-95a4-ce76da25c4cd