The `inject_ignored_hooked_blocks_metadata_attributes` filter that is attached to both the `rest_pre_insert_wp_template` and `rest_pre_insert_wp_template_part` hooks receives a `stdClass` object from the Templates REST API controller that contains all fields that the client would like to modify when making a `POST` request (plus the `id` to identify the relevant template or template part, respectively).
There are cases when the `post_content` field is not set, e.g. when the client would like to rename an existing template (in which case it would only set the `title` field).
Prior to this changeset, the filter would erroneously apply the Block Hooks algorithm to the non-existent `post_content` field regardless, which would result in it being set to the empty string `''`. As a consequence, renaming a template would have the unwanted side effect of wiping its contents.
This changeset fixes the issue by returning early from the filter if the `post_content` field is not set.
Props alshakero, bernhard-reiter.
Fixes#61550.
git-svn-id: https://develop.svn.wordpress.org/trunk@58785 602fd350-edb4-49c9-b593-d223f7449a82
This resolves the seperator block color settings ordering. They were displaying incorrectly due to ruleset problems. This edits the order for the front end also.
Props bhaveshdesai13, aniketpatel, miguelaxcar, nidhidhandhukiya, poena, pavanpatil1, sabernhardr.
Fixes#57544.
git-svn-id: https://develop.svn.wordpress.org/trunk@58784 602fd350-edb4-49c9-b593-d223f7449a82
When using the /posts or /pages endpoints, for private posts or pages, you get the following title property: { raw: "Some title", rendered: "Private: Some title" }
this commit removes the prefix from rendered private posts titles (just like what we do for protected posts)
Props youknowriad, swissspidy, timothyblynjacobs, sergeybiryukov, ramonopoly.
Fixes#61639.
git-svn-id: https://develop.svn.wordpress.org/trunk@58783 602fd350-edb4-49c9-b593-d223f7449a82
Prime the `notoptions` cache within `delete_option` and `delete_network_option` to avoid the need for a database query if `get_option` or `get_network_option` is subsequently called.
Adds some associated tests to ensure that an option is cleared from the notoptions cache when an option is added either via `add_option`, `update_option` or their network option equivalent.
Props pbearne, mukesh27.
Fixes#61484.
git-svn-id: https://develop.svn.wordpress.org/trunk@58782 602fd350-edb4-49c9-b593-d223f7449a82
Insertion modes in an HTML parser may include instructions like "process
the token in the IN HEAD insertion mode." The rules do not change the
insertion mode of the parser, but the errors are triggered outside of the
rules for the current insertion mode. These will be misleading when
bailing on these instructions, because it will point someone to the wrong
place in the code to find the source of the error.
In this patch all of the bail-points due to lacking insertion mode support
are hard-coded to better orient someone to the section of the code lacking
support for handling the input HTML.
Developed in https://github.com/wordpress/wordpress-develop/pull/7043
Discussed in https://core.trac.wordpress.org/ticket/61576
Follow-up to [58679].
Props: dmsnell, jonsurrell.
See #61576.
git-svn-id: https://develop.svn.wordpress.org/trunk@58781 602fd350-edb4-49c9-b593-d223f7449a82
When support was added for the remaining tags in the IN BODY insertion mode, a test
file indicating that support was necessary for certain parts of the parser was
removed, but it wasn't removed from SVN when sending over the patch from `git`.
This patch removes that empty file so that the WPCS workflows pass.
Discussed in https://core.trac.wordpress.org/ticket/61576
Follow-up to [58779].
See #61576.
git-svn-id: https://develop.svn.wordpress.org/trunk@58780 602fd350-edb4-49c9-b593-d223f7449a82
As part of work to add more spec support to the HTML API, this patch adds
support for the remaining missing tags in the IN BODY insertion mode. Not
all of the added tags are supported, because in some cases they reset the
insertion mode and are reprocessed where they will be rejected.
This patch also improves the support of `get_modifiable_text()`, removing
a leading newline inside a LISTING, PRE, or TEXTAREA element.
Developed in https://github.com/WordPress/wordpress-develop/pull/6972
Discussed in https://core.trac.wordpress.org/ticket/61576
Props dmsnell, jonsurrell, westonruter.
See #61576.
git-svn-id: https://develop.svn.wordpress.org/trunk@58779 602fd350-edb4-49c9-b593-d223f7449a82
When the screen is smaller the edit buttons are obscured. This resolves that problem for the smaller screens and only targets the container for footer navigation and widgets.
Props sumitsingh, SergeyBiryukov, sabernhardt.
Fixes#49008.
git-svn-id: https://develop.svn.wordpress.org/trunk@58778 602fd350-edb4-49c9-b593-d223f7449a82
When the font size is changed the border on the front was changing in width. This fix resolves that to make sure the width does not adjust.
Props nidhidhandhukiya, sabernhardt, kamran8176, pitamdey, shailu25.
Fixes#60239.
git-svn-id: https://develop.svn.wordpress.org/trunk@58777 602fd350-edb4-49c9-b593-d223f7449a82
Whilst initially this could be thought to be solved in Jetpack due to submenus only having a z-index of 1 a fix is desirable. This brings in the suggested value.
Props robertghetau, SergeyBiryukov, sabernhardt, poena, narenin.
Fixes#55892.
git-svn-id: https://develop.svn.wordpress.org/trunk@58776 602fd350-edb4-49c9-b593-d223f7449a82
We tried moving away from the deprecated React UMD builds previously,
the problem we faced is that there's a warning that is triggered on the console because we're not using a separate impact for `createRoot`.
This warning has been removed in React 19 along with the removal of the UMD builds, so we should be able to revert this commit when we upgrade to React 19 but for now, we need to restore the usage of the umd builds.
Props mamaduka.
See #61324.
git-svn-id: https://develop.svn.wordpress.org/trunk@58775 602fd350-edb4-49c9-b593-d223f7449a82
Includes updating the context to match the pre-existing block editor translations.
Follow-up to [58284].
Props sabernhardt, Marius84.
Fixes#61714.
git-svn-id: https://develop.svn.wordpress.org/trunk@58774 602fd350-edb4-49c9-b593-d223f7449a82
This resolves an `Undefined array key "host"` PHP warning if `WP_CONTENT_URL` is set to a relative URL.
Follow-up to [58097].
Props mattraines, narenin, pamprn, SergeyBiryukov.
Fixes#61690.
git-svn-id: https://develop.svn.wordpress.org/trunk@58773 602fd350-edb4-49c9-b593-d223f7449a82
The List Block when had padding was not displaying the background color correctly. This only impacts the non-framed editor.
Props viralsampat, devtanbir, sabernhardt, deepakvijayan.
Fixes#60197.
git-svn-id: https://develop.svn.wordpress.org/trunk@58772 602fd350-edb4-49c9-b593-d223f7449a82
The function twentysixteen_entry_meta included screen reader text inside the span property using the author mf class. This resolves that in both Twenty Sixteen and Twenty Fifteen. It should have the screen reader text inside the byline span but outside the author vcard span.
Props dshanske, laurelfulford, sabernhardt, shilu25.
Fixes#46233.
git-svn-id: https://develop.svn.wordpress.org/trunk@58771 602fd350-edb4-49c9-b593-d223f7449a82
There were a number of typos in the patterns. These came in [58111] with some additions having issues and so this resolves that.
Props tobifjellner, sabernhardt, audrasjb.
Fixes#61682.
git-svn-id: https://develop.svn.wordpress.org/trunk@58770 602fd350-edb4-49c9-b593-d223f7449a82
This patch adds type annotations to internal and private methods of the HTML
API and the supporting WP_Token_Map. Annotations have not been added to the
public interfaces where it would likely crash a site if called wrong.
These annotations should help avoid unnecessary type-related bugs (as have
been uncovered in earlier work adding such annotations) and provide additional
guidance to developers when interacting with these classes in an IDE.
Developed in https://github.com/WordPress/wordpress-develop/pull/6753
Discussed in https://core.trac.wordpress.org/ticket/61399
Props dmsnell, jonsurrell.
See #61399.
git-svn-id: https://develop.svn.wordpress.org/trunk@58769 602fd350-edb4-49c9-b593-d223f7449a82
The function returns `null` if `$template_type` is not `wp_template` or `wp_template_part`.
Follow-up to [52062].
Props dilipbheda, mukesh27.
Fixes#61705.
git-svn-id: https://develop.svn.wordpress.org/trunk@58768 602fd350-edb4-49c9-b593-d223f7449a82
The `workflow_dispatch` event payload does not contain the `before` property containing the previous commit’s SHA value, which causes scheduled runs of the performance testing workflow in older branches to fail.
This adds a step specifically for this event type to use native Git commands to retrieve the required SHA value instead.
Props joemcgill.
Fixes#61699.
git-svn-id: https://develop.svn.wordpress.org/trunk@58767 602fd350-edb4-49c9-b593-d223f7449a82
#61182 introduced is_utf8_charset() as a way of standardizing checks for charset slugs referring to UTF-8. This is called by _mb_strlen() inside of compat.php, but is_utf8_charset() is defined in functions.php, which isn't loaded early on. Code calling mb_strlen() early on before functions.php loads in hosts without the multibyte extension therefore may crash.
Props dmsnell, jonsurrell, joemcgill, jorbin.
Fixes#61681.
git-svn-id: https://develop.svn.wordpress.org/trunk@58763 602fd350-edb4-49c9-b593-d223f7449a82
Per coding standards, capitalizes the first character of the inline comment in the test dataset.
Follow-up to [58755].
Props SergeyBiryukov.
See #61681.
git-svn-id: https://develop.svn.wordpress.org/trunk@58756 602fd350-edb4-49c9-b593-d223f7449a82
[58335] introduced `(string)` type casting of the passed in `$comment_id` value. If `$comment_id` is a scalar, it works as expected. But if it's an `object`, the following fatal error is thrown:
{{{
Object of class WP_Comment could not be converted to string
}}}
This fatal error happens when the incoming `$comment_id` is an instance of `WP_Comment` (or any object) without a `comment_ID` (empty).
This changeset adds tests to demonstrate the fatal error and validate the fix.
It fixes the fatal error by restructuring the ternary checks into an `if/elseif/else` structure for the 3 paths:
- When `$comment->comment_ID` is not empty, then it uses the property.
- When `$comment_id` is scalar, then it type casts it to a `string`.
- Else, the default is an empty `string`.
Follow-up to [58335], [41127], [52818].
Props ambrosiawt, hellofromTonya, jorbin, mukesh27, SergeyBiryukov.
Fixes#61681.
git-svn-id: https://develop.svn.wordpress.org/trunk@58755 602fd350-edb4-49c9-b593-d223f7449a82
Prior to WordPress 6.4, performance testing was performed using Puppeteer instead of Playwright (converted in [56926]). Because of the flaky nature of the workflow using Puppeteer, it was not converted to the reusable pattern implemented through #61213. It was instead removed from 6.2 and 6.3 in [58301] and [58330], respectively.
This removes the workflow for these branches from the strategy matrix when testing old branches to avoid errors and adds an expanded note about why those branches are missing.
See #61213, #61564.
git-svn-id: https://develop.svn.wordpress.org/trunk@58754 602fd350-edb4-49c9-b593-d223f7449a82
In the Layout block support, handle 0 values for padding as 0px in calc()
rules. This resolves a bug for nested fullwidth layouts when zero padding is
applied. Due to how calc() works, without supplying the unit, the rule will not
work, resulting in a horizontal scrollbar.
Backports the PHP changes in https://github.com/WordPress/gutenberg/pull/63436.
Fixes#61656.
Props andrewserong, mukesh27, aaronrobertshaw.
git-svn-id: https://develop.svn.wordpress.org/trunk@58750 602fd350-edb4-49c9-b593-d223f7449a82
Following [58215], admin bar items in the `top-secondary` group have a changed visual order. Increase the priority of the user and recovery menu items so nodes added with higher priorities will still be shown visually before the user and recovery menu items, as they were prior to 58215.
The items will appear in the reverse of the previous order, but the new order now matches their priority order, rather than being the opposite.
Props sabernhardt, joemcgill, pbiron, joedolson.
Fixes#61615.
git-svn-id: https://develop.svn.wordpress.org/trunk@58748 602fd350-edb4-49c9-b593-d223f7449a82
The CSS to make menu item containers resizable in the admin menu editor was too broadly scoped, and caused classic editor metaboxes to have unconstrained height. Limit the scope of the CSS changes to only impact menu item containers.
Props neotrope, sabernhardt, joedolson.
Fixes#61662.
git-svn-id: https://develop.svn.wordpress.org/trunk@58747 602fd350-edb4-49c9-b593-d223f7449a82
In part of a larger review of CSS semantics and behaviors, this patch
takes the opportunity to remove leading whitespace in an updated class
attribute after the first class in the attribute has been removed.
Previously, if the first class name had been removed, the whitespace
that formerly followed it would remain in the class attribute. This
stood in contrast to removing other class names, which removed their
associated whitespace.
There should be no semantic or functional changes in this patch, only
a slightly-large diff for modified HTML documents that looks prettier
when removing the first class name in a class attribute.
Developed in https://github.com/WordPress/wordpress-develop/pull/6933
Discussed in https://core.trac.wordpress.org/ticket/61531
Props dmsnell, jonsurrell.
See #61531.
git-svn-id: https://develop.svn.wordpress.org/trunk@58740 602fd350-edb4-49c9-b593-d223f7449a82
Refactors the following tests to use a data provider with named test cases:
* `test_wp_interactivity_data_wp_context_with_different_arrays()`
* `test_wp_interactivity_data_wp_context_with_different_arrays_and_a_namespace()`
* `test_wp_interactivity_data_wp_context_with_json_flags()`
This is better as:
1. One failing test will not block the other tests from running.
2. Each test is now referenced by name in any error message, making it more straight forward to see which test failed.
3. The test no longer contains multiple assertions.
3. It makes it more straight forward to add additional tests.
Follow-up to [58594], [58234], [57762], [57743], [57742], [57563].
Props jrf.
See #61530.
git-svn-id: https://develop.svn.wordpress.org/trunk@58739 602fd350-edb4-49c9-b593-d223f7449a82
Once the `test_process_directives_when_block_is_filtered()` method has run, the named `test_render_block_data()` function declared nested within becomes part of the global namespace, which could cause problems for other tests.
Quite apart from the fact that the name starting with `test_` is confusing (as methods prefixed with `test_` are supposed to be test methods to be run by PHPUnit).
Using a closure for this callback fixes the issue. Declared as `static` for a micro-optimization.
Follow-up to [57826].
Props jrf, hellofromTonya.
See #61530.
git-svn-id: https://develop.svn.wordpress.org/trunk@58738 602fd350-edb4-49c9-b593-d223f7449a82
Changeset [58712] introduced the following compile time PHP deprecation notice on >= PHP 8.2 test runs:
{{{
Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /var/www/tests/phpunit/tests/html-api/wpHtmlProcessorHtml5lib.php on line 257
PHPUnit 9.6.20 by Sebastian Bergmann and contributors.
}}}
The `${` syntax for string interpolation was deprecated in PHP 8.2 and should not be used anymore.
Ref: https://wiki.php.net/rfc/deprecate_dollar_brace_string_interpolation
Follow-up to [58712].
Props jrf.
See #61530, #59654, #61576.
git-svn-id: https://develop.svn.wordpress.org/trunk@58733 602fd350-edb4-49c9-b593-d223f7449a82
This brings spacing in that was missing for both Twenty Seventeen and also Twenty Nineteen. It was missing between the words.
Props pitamdey, sabernhardt, nidhidhandhukiya, poena.
Fixes#59334.
git-svn-id: https://develop.svn.wordpress.org/trunk@58732 602fd350-edb4-49c9-b593-d223f7449a82
The font family was not showing correctly for the verse block. The approach taken was to match the front end and this involved also removing the styles in [50358].
Props pranitdugad, sabernhardt, poena, pitamdey.
Fixes#61140.
git-svn-id: https://develop.svn.wordpress.org/trunk@58731 602fd350-edb4-49c9-b593-d223f7449a82
The font family was not being included for the code block. This adds Inconsolata to the code block within the editor styles.
Props pranitdugad, sabernhardt.
Fixes#61571.
git-svn-id: https://develop.svn.wordpress.org/trunk@58730 602fd350-edb4-49c9-b593-d223f7449a82
The border was not changing color when it was changed. This brings that in. It is worth noting the original theme design did not have this but as noted in the ticket this has been in the quote block for about two years so matching the current block styling in this case makes sense.
Props umesh84, desrosj, sabernhardt.
Fixes#56565.
git-svn-id: https://develop.svn.wordpress.org/trunk@58728 602fd350-edb4-49c9-b593-d223f7449a82
The border was not showing on search block. This brings in a resolution for that removing the none from border property.
Props viralsampat, poena, sabernhardt.
Fixes#60669.
git-svn-id: https://develop.svn.wordpress.org/trunk@58727 602fd350-edb4-49c9-b593-d223f7449a82
There was a text alignment issue not centering on all screen sizes. This fixes that and centers vertically.
Props vijaysinh9094, poena, sabernhardt.
Fixes#61633.
git-svn-id: https://develop.svn.wordpress.org/trunk@58726 602fd350-edb4-49c9-b593-d223f7449a82
The button block had issues with font styling not applying. This not only brings letter-spacing but also line-height, text-transform and font-weight to wp-button-block-buttons. [57300] fixed the separator issue. This fix also added box-shadow none for consistency.
Props darshitrajyaguru97, harshgajipara, shailu25, sabernhardt, alvitazwar052.
Fixes#58609.
git-svn-id: https://develop.svn.wordpress.org/trunk@58725 602fd350-edb4-49c9-b593-d223f7449a82
Pullquote was not showing the color changes. This uses inherit to do that. It also removes the changes from [58368] as this method is preferred.
Props viralsampat, poena, sabernhardt.
Fixes#59801.
git-svn-id: https://develop.svn.wordpress.org/trunk@58724 602fd350-edb4-49c9-b593-d223f7449a82