The Block Hooks mechanism was previously extended to allow insertion of a block as a Navigation block's first or last child. This was implemented by storing the `ignoredHookedBlocks` array in the corresponding `wp_navigation` post's post meta (instead of a metadata attribute on the anchor block).
This changeset extends that mechanism to Template Part blocks, by storing said metadata in the corresponding `wp_template_part` post's post meta, thus allowing extenders to use Block Hooks to insert a block as a Template Part block's first or last child, respectively.
Props tomjcafferkey, bernhard-reiter.
Fixes#60854.
Built from https://develop.svn.wordpress.org/trunk@58614
git-svn-id: http://core.svn.wordpress.org/trunk@58047 1a063a9b-81f0-0310-95a4-ce76da25c4cd
As of [58457], the width and height cropping values are cast to an integer before the comparison to see if the target width and height differ from the original width and height.
Since they are now integers, it exposes a bug where the `&&` of the `if` conditional meant that if you were only cropping in one dimension, the check wouldn't pass, and cropping would not occur.
In the block editor, the cropping tools are aspect ratio based, so one of the dimensions will always match that of the source image. Therefore, now that the values are cast as integers, the condition that allows a cropping to occur needs to be updated. If either width or height is different from the source image, then a crop should be allowed.
Follow-up to [50124], [58457].
Props andrewserong, jrf, kevin940726.
Fixes#61514. See #59782.
Built from https://develop.svn.wordpress.org/trunk@58612
git-svn-id: http://core.svn.wordpress.org/trunk@58045 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This updates the reusable coding standards GitHub Actions workflow to support the old way of running PHPCS commands when the `old-branches` input flag is set to `true`. This allows the 5.1-5.4 branches to use the same workflow as all other 5.5+ branches.
See #61213.
Built from https://develop.svn.wordpress.org/trunk@58596
git-svn-id: http://core.svn.wordpress.org/trunk@58042 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The changes associated with #61213 aim to update all branches potentially receiving security updates to use the same workflow files for easier maintenance as much as possible. However, there are times when the logic found in GitHub Action workflow files changes pretty drastically.
For PHPUnit testing, there are 2 instances where this occurred: the 5.2 and 5.9 branches. This changeset introduces 2 new reusable PHPUnit workflow files for use the 4.1-5.1 and 5.2-5.9 branches.
Including these workflows in `trunk` makes it more clear which version of the workflow file is used by these old branches, and allows Dependabot to open PRs for updating 3rd-party actions within these workflows.
Props jorbin.
See #61213.
Built from https://develop.svn.wordpress.org/trunk@58595
git-svn-id: http://core.svn.wordpress.org/trunk@58041 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This ensures that not only the return values match the expected results, but also that their type is the same.
Going forward, stricter type checking by using `assertSame()` should generally be preferred to `assertEquals()` where appropriate, to make the tests more reliable.
Follow-up to [57563], [57649], [57822], [57826], [57835], [58159], [58327].
See #61530.
Built from https://develop.svn.wordpress.org/trunk@58594
git-svn-id: http://core.svn.wordpress.org/trunk@58040 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When [58304] introduced the abililty to visit virtual nodes in the HTML document,
those being the nodes which are implied by the HTML but no explicitly present in
the raw text, a bug was introduced in the `get_breadcrumbs()` method because it
wasn't updated to be aware of the virtual nodes. Therefore it would report the
wrong breadcrumbs for virtual nodes. Since the new `get_depth()` method is based
on the same logic it was also broken for virtual nodes.
In this patch, the breadcrumbs have been updated to account for the virtual nodes
and the depth method has been updated to rely on the fixed breadcrumb logic.
Developed in https://github.com/WordPress/wordpress-develop/pull/6914
Discussed in https://core.trac.wordpress.org/ticket/61348
Follow-up to [58304].
Props dmsnell, jonsurrell, zieladam.
See #61348.
Built from https://develop.svn.wordpress.org/trunk@58588
git-svn-id: http://core.svn.wordpress.org/trunk@58035 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This partially reverts [58563], which applied an update of the `uglify-js` `devDependency` from `3.17.4` to `3.18.0`.
The `3.18.0` update is causing some JavaScript errors in the `media-views.min.js` file, so needs to be investigated further.
Props david.binda, mukesh27, alshakero.
Fies #61519.
Built from https://develop.svn.wordpress.org/trunk@58585
git-svn-id: http://core.svn.wordpress.org/trunk@58032 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The first tag wasn't switching correctly. This resolves it for an adjacent RTL language link setting list items to inline-block.
Props manooweb, audrasjb, SergeyBiryukov, davidbaumwald, marybaum, sabernhardt.
Fixes#46658.
Built from https://develop.svn.wordpress.org/trunk@58582
git-svn-id: http://core.svn.wordpress.org/trunk@58029 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Includes restoring paragraph tags for “User updated” and “← Go to Users” messages, so that the arrow is not on the same line as the previous message.
Follow-up to [56570].
Props Presskopp, narenin, swissspidy, SergeyBiryukov.
Fixes#61506.
Built from https://develop.svn.wordpress.org/trunk@58581
git-svn-id: http://core.svn.wordpress.org/trunk@58028 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Add a new filter `script_module_data_{$module_id}` to associate data
with a Script Module. For example:
{{{#!php
add_filter(
'script_module_data_MyScriptModuleID',
function ( array $data ): array {
$data['script-needs-this-data'] = 'ok';
return $data;
}
);
}}}
If the Script Module is included in the page, enqueued or as a
dependency, the associated data will be JSON-encoded and embedded in the
HTML in a `<script type="application/json">` tag with an ID of the form
`wp-script-module-data-{$module_id}` allowing the Script Module to
access the data on the client.
See the original proposal: https://make.wordpress.org/core/2024/05/06/proposal-server-to-client-data-sharing-for-script-modules/
Developed in https://github.com/WordPress/wordpress-develop/pull/6682.
Props jonsurrell, cbravobernal, westonruter, gziolo, bernhard-reiter, youknowriad, sergiomdgomes, czapla.
Fixes#61510. See #60647.
Built from https://develop.svn.wordpress.org/trunk@58579
git-svn-id: http://core.svn.wordpress.org/trunk@58026 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Prior to this changeset, the function `update_ignored_hooked_blocks_postmeta()` used the core function `update_post_meta()` to write `_wp_ignored_hooked_blocks` data to the database during an operation that is preparing a post to be inserted.
Since we have access to the incoming changes that are being prepared we can remove this database operation in favour of writing the data to the post object provided under `meta_input`.
Doing this means two things:
1. It allows us to store postmeta for new posts that are about to be created since they don't have an `ID` yet (which is information `update_post_meta()` needs).
2. The core controller will take care of updating postmeta in a more predictable pattern.
Props tomjcafferkey, bernhard-reiter.
Fixes#61495.
Built from https://develop.svn.wordpress.org/trunk@58578
git-svn-id: http://core.svn.wordpress.org/trunk@58025 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In [58470] a change was made to normalize the filename in validate_file, however this leads to instances where the list of files that are allowed aren't normalized such as in the theme editor. By normalizing the array, the comparison is apples to apples.
Fixes#61488.
Props jorbin, hellofromtonya, swissspidy, misulicus, script2see, Presskopp, audrasjb, peterwilsoncc, siliconforks, littler.chicken, paulkevan,
Built from https://develop.svn.wordpress.org/trunk@58570
git-svn-id: http://core.svn.wordpress.org/trunk@58018 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This rebuilds compiled CSS files after updating the `caniuse` database in [58563].
All `-webkit-clip-path` properties have been removed as the corresponding browsers dipped below 1% usage and have fallen out of the browser support policy.
Fixes#61499.
Built from https://develop.svn.wordpress.org/trunk@58567
git-svn-id: http://core.svn.wordpress.org/trunk@58015 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This takes into account the changes from #47125 and updates the related Help Tabs content accordingly.
Follow-up to [56515].
Props johnbillion, renishsurani, faisal03, shailu25, sumitbagthariya16, Ankit-K-Gupta, oglekler, rajinsharwar, hmbashar, huzaifaalmesbah.
Fixes#61153.
Built from https://develop.svn.wordpress.org/trunk@58564
git-svn-id: http://core.svn.wordpress.org/trunk@58012 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This patch introduces two related changes:
- It adds missing subclass methods on the HTML Processor which needed
to be implemented since it started visiting virtual nodes. These
methods need to account for the fact that not all tokens truly exist.
- It adds a new concept and internal method, `is_virtual()`, indicating
if the currently-matched token comes from the raw text in the input
HTML document or if it was the byproduct of semantic parsing rules.
This internal method and new vocabulary around token provenance
considerably simplifies the logic spread throughout the rest of the
class and its subclass methods.
Developed in https://github.com/WordPress/wordpress-develop/pull/6860
Discussed in https://core.trac.wordpress.org/ticket/61348
Follow-up to [58304].
Props dmsnell, jonsurrell, gziolo.
See #61348.
Built from https://develop.svn.wordpress.org/trunk@58558
git-svn-id: http://core.svn.wordpress.org/trunk@58006 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This ensures that not only the return values match the expected results, but also that their type is the same.
Going forward, stricter type checking by using `assertSame()` should generally be preferred to `assertEquals()` where appropriate, to make the tests more reliable.
Follow-up to [55959], [55986], [57547], [57716], [58244], [58422].
See #60706.
Built from https://develop.svn.wordpress.org/trunk@58478
git-svn-id: http://core.svn.wordpress.org/trunk@57927 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When a border color and width was added to the pullquote block but no border style was chosen the border was not visible. The expectation is that the border has a solid style by default when a color is selected.
Props pranitdugad, poena, sabernhardt.
Fixes#61362.
Built from https://develop.svn.wordpress.org/trunk@58469
git-svn-id: http://core.svn.wordpress.org/trunk@57918 1a063a9b-81f0-0310-95a4-ce76da25c4cd