Commit Graph

48320 Commits

Author SHA1 Message Date
Jonathan Desrosiers
3f76edda70 External Libraries: Update the regenerator-runtime version.
Adds the required change to the `script-loader.php` file for [56626] that was missed.

See #59078.

git-svn-id: https://develop.svn.wordpress.org/trunk@56627 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-19 19:30:51 +00:00
Jonathan Desrosiers
e266e9391b External Libraries: Update the regenerator-runtime library.
This updates the `regenerator-runtime` library to version `0.14.0`.

Props rajinsharwar, oglekler.
Fixes #59078.

git-svn-id: https://develop.svn.wordpress.org/trunk@56626 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-19 19:28:02 +00:00
Joe McGill
3bacfc9f97 Media: Edit new hook name in get_available_post_mime_types().
This is a follow-up to [56452] in which a new filter hook was added to `get_available_post_mime_types()` to override a potentially slow query. This renames the previous hook from `get_available_post_mime_types` to `pre_get_available_post_mime_types` for clarity.

Props rcorrales, emrikol, johnbillion, joemcgill, mukesh27.
Fixes #52759.


git-svn-id: https://develop.svn.wordpress.org/trunk@56623 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-19 17:03:23 +00:00
Colin Stewart
7d96189ba1 Build/Test Tools: Add sys_get_temp_dir() to open_basedir tests.
In PHPUnit 10.3.5, 9.6.13 and 8.5.34, the child processes used for process isolation now use temporary files to communicate their result to the parent process.

This caused a failure in some tests that set the `open_basedir` PHP directive to a value that did not include `sys_get_temp_dir()`.

This adds `sys_get_temp_dir()` to the `open_basedir` value set by the tests to ensure that permission is still granted for the temporary directory.

PHPUnit uses `sys_get_temp_dir()`. To ensure the result is the same, Core's `get_temp_dir()` function is not used.

References:
- https://github.com/sebastianbergmann/phpunit/issues/5356

Props desrosj, mukesh27, SergeyBiryukov, costdev.
Fixes #59394.

git-svn-id: https://develop.svn.wordpress.org/trunk@56622 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-19 16:41:22 +00:00
Jonny Harris
9a734f3751 Themes: Improve performance of get_block_theme_folders function
This commit enhances the performance of the get_block_theme_folders function by introducing a new method called get_block_template_folders within the WP_Theme class. Previously, this function suffered from poor performance due to repeated file lookups using file_exists. The new method implements basic caching, storing the result in the theme's cache, similar to how block themes are cached in the block_theme property (see [55236]).

Additionally, this change improves error handling by checking if a theme exists before attempting to look up the file. It also enhances test coverage. 

Props spacedmonkey, thekt12, swissspidy, flixos90, costdev, mukesh27.
Fixes #58319.

git-svn-id: https://develop.svn.wordpress.org/trunk@56621 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-19 16:15:52 +00:00
Greg Ziółkowski
48b9b6cbab Blocks: Introduce a variation of serialize blocks helper with traversing
Introduces two new functions `traverse_and_serialize_blocks` and `traverse_and_serialize_block` with the additional `$callback` argument. It is possible to pass parent block, block index, chunk index to the callback argument.

Reverts changes applied to `serialize_blocks` and `serialize_block` in #59327 with [56557].

Props ockham, mukesh27.
See #59313.




git-svn-id: https://develop.svn.wordpress.org/trunk@56620 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-19 12:48:41 +00:00
Colin Stewart
3916624c13 Editor: Fix parameter reference in block editor settings tests.
In [50776], the `filter_set_block_editor_settings_post()` callback was introduced for use in block editor settings tests.

This contained a reference to an `$allowed_block_types` parameter, which doesn't exist.

This changes the reference to `$editor_settings`.

Follow-up to [50776].

Props david.binda, mukesh27, SergeyBiryukov.
Fixes #59391.

git-svn-id: https://develop.svn.wordpress.org/trunk@56619 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-19 12:36:44 +00:00
Bernie Reiter
8e8de91f0a Blocks: Implement block insertion functions.
For #59313, we need to implement functions to insert a given parsed block into another parsed block's inner blocks, and to prepend and append to that array, respectively.

We will use those functions in combination with `traverse_and_serialize_blocks` (see #59327) to implement automatic insertion of hooked blocks into block templates and patterns.

Props gziolo.
Fixes #59385.

git-svn-id: https://develop.svn.wordpress.org/trunk@56618 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-19 12:34:50 +00:00
Sergey Biryukov
cf2f441515 KSES: Add writing-mode to the list of safe CSS properties.
Original PR from Gutenberg repository:
* [https://github.com/WordPress/gutenberg/pull/54581 #54581 Gutenberg Plugin: Add hook to allow `writing-mode` as a safe CSS property]

Reference: [https://developer.mozilla.org/en-US/docs/Web/CSS/writing-mode MDN Web Docs: writing-mode].

Follow-up to [56605].

Props wildworks, mukesh27, poena, andrewserong.
Fixes #59387.

git-svn-id: https://develop.svn.wordpress.org/trunk@56617 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-19 12:28:25 +00:00
Colin Stewart
8ce85f99f3 Coding Standards: Replace PHP alias join() with implode().
In [52190], some new instances of the `join()` alias were introduced in the test suite.

Using the canonical function name for PHP functions is strongly recommended, as aliases may be deprecated or removed without (much) warning.

This replaces the new `join()` uses with the canonical `implode()` function name.

Follow-up to [46182], [49193], [49805], [52190].

Props david.binda, mukesh27.
Fixes #59389.

git-svn-id: https://develop.svn.wordpress.org/trunk@56616 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-19 12:23:16 +00:00
Isabel Brison
1cd98779f7 Editor: fix pattern alignment in editor view.
Adjusts root padding for synced patterns in the editor to avoid discrepancies with the front end view.

Props aaronrobertshaw, mukesh27.
Fixes  #59359.


git-svn-id: https://develop.svn.wordpress.org/trunk@56615 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-19 01:43:07 +00:00
Isabel Brison
1327f172cd Editor: add background image support.
Adds a new background block support with the ability to set a background image on blocks that opt into it.

Props andrewserong, mukesh27.
Fixes #59357.


git-svn-id: https://develop.svn.wordpress.org/trunk@56614 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-19 01:27:43 +00:00
Felix Arntz
d4cf682716 Bundled Theme: Add missing dimension attributes to images in Twenty Twenty-Two patterns.
The dimension attributes `width` and `height` should be present on every image in order to avoid layout shifts and be able to leverage WordPress core's image loading optimization functionality.

This changeset adds dimension attributes to the `core/image` blocks used in block patterns in Twenty Twenty-Two, where this is particularly critical as WordPress core cannot backfill the attributes for those images, as their sources are not part of the Media Library.

Props spacedmonkey, thekt12, mukesh27, flixos90.
Fixes #59256.


git-svn-id: https://develop.svn.wordpress.org/trunk@56613 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-18 17:36:51 +00:00
Felix Arntz
414a1232c2 Media: Enhance wp_get_loading_optimization_attributes() to support arbitrary context values.
The `wp_get_loading_optimization_attributes()` function, which was introduced in 6.3, based on the now deprecated `wp_get_loading_attr_default()` function introduced in 5.5, relies on a `$context` parameter based on which it may alter its behavior and the attributes returned. So far, it has only supported context values used within WordPress core.

This changeset decouples the behaviors of the function from specific contexts, allowing for more flexibility. Theme and plugin developers will be able to rely on their own context values when rendering images in non-standard ways, rather than being forced to use a core context, to get the loading optimization benefits the function provides.

As part of this change, a `wp_loading_optimization_force_header_contexts` filter is introduced, which allows filtering the map of context values and whether they should be considered header contexts, i.e. i.e. any image having one of these contexts will be assumed to appear above the fold.

Props mukesh27, costdev, flixos90.
Fixes #58894.


git-svn-id: https://develop.svn.wordpress.org/trunk@56612 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-18 14:53:37 +00:00
Sergey Biryukov
6a264d2de0 Quick Edit: Allow Quick Edit to be disabled for custom post types or taxonomies.
Some custom post types or taxonomies may not need the Quick Edit functionality, in which case adding hidden fields and rendering the form with the data to edit would be redundant.

This commit introduces two filters for more granular control:

* `quick_edit_enabled_for_post_type`
* `quick_edit_enabled_for_taxonomy`

Follow-up to [8857], [9083], [9098].

Props garyc40, sabernhardt, mukesh27, costdev, oglekler, wyrfel, peterwilsoncc, faguni22, robinwpdeveloper, webcommsat, johnbillion, azaozz, hellofromTonya, GunGeekATX, Jick, mikeschinkel, jane, nacin, helen, wonderboymusic, DrewAPicture, SergeyBiryukov.
Fixes #16502, #19343, #57596.

git-svn-id: https://develop.svn.wordpress.org/trunk@56611 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-18 13:17:39 +00:00
Greg Ziółkowski
6340624328 Blocks: Introduce helper function to retrieve hooked blocks
In order to implement Block Hooks (see #59313), we added block_hooks field to the WP_Block_Type class, as well as to block registration related functions. In this follow-up, new helper function gets introduced that is going to compute the list of hooked blocks by other registered blocks for a given block type.

Extracted from https://github.com/WordPress/wordpress-develop/pull/5158 and covered with unit tests.

Props ockham.
Fixes #59383.



git-svn-id: https://develop.svn.wordpress.org/trunk@56610 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-18 12:40:11 +00:00
Jonny Harris
4ee594761f Plugins: Store result of call to array_keys, to save repeated calls in WP_Hook class.
In the `WP_Hook` class the function `array_keys` was called every time an array of hook priorities was needed. For sites with lots of filters or actions, this would result in thousands of calls to the `array_keys` function, which uses server resources. Instead of recomputing this array every time it is needed, only compute it when filters are added and removed, then store the result as a class property. Improve unit tests to ensure this behaviour is tested. 

Props spacedmonkey, bor0, flixos90, hellofromTonya, mukesh27.
Fixes #58458.

git-svn-id: https://develop.svn.wordpress.org/trunk@56609 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-18 12:39:18 +00:00
Colin Stewart
a7c9394b78 Docs: Document aria-live and hidden in safecss_filter_attr().
In [56603], support was added for `aria-live` and `hidden` attributes in `safecss_filter_attr()`.

This adds a `@since` annotation to document this change.

Follow-up to [56603].

Props mukesh27.
See #57791.

git-svn-id: https://develop.svn.wordpress.org/trunk@56608 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-18 10:55:35 +00:00
Greg Ziółkowski
d47515c274 Tests: Add additional tests covering Block Hooks registration
Props ockham.
See #59346.
Follow-up [56587].



git-svn-id: https://develop.svn.wordpress.org/trunk@56607 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-18 10:33:24 +00:00
Isabel Brison
3239a8e8f4 Posts: update admin notices to refer to patterns.
Updates `wp_block` action notices to refer to patterns instead of blocks.

Props aaronrobertshaw, mukesh27, oglekler.
Fixes #59305.


git-svn-id: https://develop.svn.wordpress.org/trunk@56606 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-18 07:02:45 +00:00
Isabel Brison
da48a9e76e Editor: add text orientation for blocks with typography support.
Adds a new text orientation option to the typography block support, implemented with CSS writing-mode.

Props poena.
Fixes #59306.


git-svn-id: https://develop.svn.wordpress.org/trunk@56605 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-18 06:47:44 +00:00
Isabel Brison
ac8db41833 Editor: add block instance element color support for buttons and headings.
Adds support for buttons and headings to the colors and elements block supports, allowing button and heading element colors to be changed on individual blocks.

Props aaronrobertshaw.
Fixes #59309.



git-svn-id: https://develop.svn.wordpress.org/trunk@56604 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-18 06:25:49 +00:00
Joe Dolson
4bcf32a698 Administration: Add support for attributes in wp_admin_notice().
Allow admin notices to be created with additional attributes. Test attributes include `hidden`, `data-*`, and `role="*"` values, which are all in use in various admin notices across core. 

This commit adds `aria-live` and `hidden` to the KSES global attributes array to support core usages.

Follow up to [56408], [56409], [56410], [56518], [56570], [56571], [56572], [56573], [56576], [56589], [56590], [56597], [56599], [56600], [56601], [56602].

Props costdev, joedolson.
See #57791.

git-svn-id: https://develop.svn.wordpress.org/trunk@56603 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-18 00:28:24 +00:00
Joe Dolson
4e0e46018d Administration: Move tabindex="-1" from notice to JS.
In a handful of admin notices, a `tabindex` attribute is set so that JS can move focus to the notice `div`. Rather than adding `tabindex` to globally accepted attributes for `wp_kses_post()`, move the assignment of `tabindex` into the JS handlers that display those notices. The attribute is only relevant if JS is running, so there is no reason to add it in the original HTML notice.

Follow up to [56408], [56409], [56410], [56518], [56570], [56571], [56572], [56573], [56576], [56589], [56590], [56597], [56599], [56600], [56601].

Props costdev, joedolson.
See #57791.

git-svn-id: https://develop.svn.wordpress.org/trunk@56602 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-17 22:49:06 +00:00
Joe Dolson
1e11c3fce8 Administration: Use wp_admin_notice() in wp-admin/network/.
Add additional usage of `wp_admin_notice()` in `wp-admin/network/` where previously overlooked. 

Follow up to [56408], [56409], [56410], [56518], [56570], [56571], [56572], [56573], [56576], [56589], [56590], [56597], [56599], [56600].

Props costdev, joedolson.
See #57791.

git-svn-id: https://develop.svn.wordpress.org/trunk@56601 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-17 19:10:58 +00:00
Joe Dolson
f058bd1217 Administration: Use wp_admin_notice() more in wp-admin/.
Add additional usage of `wp_admin_notice()` in `wp-admin/` on `.error` and miscellaneous usages previously overlooked. 

Follow up to [56408], [56409], [56410], [56518], [56570], [56571], [56572], [56573], [56576], [56589], [56590], [56597], [56599].

Props costdev, joedolson.
See #57791.

git-svn-id: https://develop.svn.wordpress.org/trunk@56600 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-17 15:31:32 +00:00
Colin Stewart
ce32693b3d Administration: Use wp_admin_notice() more in /wp-admin/includes/.
Adds further usages of `wp_admin_notice()` in `/wp-admin/includes/` on `.notice-error`, `.notice-warning`, `.error`, and `.updated`.

Ongoing task to implement new function across core.

Follow-up to [56408], [56409], [56410], [56518], [56570], [56571], [56572], [56573], [56576], [56589], [56590], [56597].

Props joedolson, mukesh27, costdev.
See #57791.

git-svn-id: https://develop.svn.wordpress.org/trunk@56599 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-17 15:21:07 +00:00
Sergey Biryukov
fe097d1686 Coding Standards: Fix a few newly introduced WPCS issues.
Follow-up to [56515], [56557], [56560].

Props jrf.
See #59161, #58831.

git-svn-id: https://develop.svn.wordpress.org/trunk@56598 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-17 02:08:25 +00:00
Colin Stewart
5cfb817067 Administration: Increase wp_admin_notice() usage in /wp-includes/.
Adds further usages of `wp_admin_notice()` in the root level of `/wp-includes/` on `.error` and `.notice-info`.

Ongoing task to implement new function across core.

Follow-up to [56408], [56409], [56410], [56518], [56570], [56571], [56572], [56573], [56576], [56589], [56590].

Props joedolson, costdev.
See #57791.

git-svn-id: https://develop.svn.wordpress.org/trunk@56597 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-16 21:47:22 +00:00
Sergey Biryukov
8161a8c62a Coding Standards: Remove extra parentheses in a few str_contains() conditionals.
Follow-up to [55988].

Props Cybr.
See #58831.

git-svn-id: https://develop.svn.wordpress.org/trunk@56596 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-16 06:48:59 +00:00
Jonny Harris
0c7ddbd67a Options, Meta APIs: Optimize get_option by relocating notoptions cache lookup.
In the get_option function, a cache lookup for the notoptions key is performed, which stores an array of keys for options known not to exist. This optimization prevents repeated database queries when certain options are requested. However, the cache lookup for notoptions was conducted before checking if the requested option exists in the cache. Given that it's more likely that the option does exist, this commit reorders the checks to first verify the option's existence in the cache before confirming its absence. This adjustment reduces redundant queries and also eliminates an unnecessary cache lookup, improving overall performance.

Props spacedmonkey, costdev, flixos90, azaozz.
Fixes #58277.

git-svn-id: https://develop.svn.wordpress.org/trunk@56595 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-15 16:13:52 +00:00
Sergey Biryukov
60d2d8ac75 Coding Standards: Remove the custom property for the FileName sniff.
Test files should comply with the naming conventions accepted by PHPUnit, not with the WP naming conventions.

While the `WordPress.File.FileName` sniff makes a best effort to prevent throwing errors for files containing test classes, the recommended manner to deal with test files is to exclude the complete test directory from being subject to this sniff.

This updates the ruleset to follow the recommendation.

Follow-up to [42346], [45607].

Props jrf.
See #59161.

git-svn-id: https://develop.svn.wordpress.org/trunk@56594 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-15 10:45:18 +00:00
Sergey Biryukov
ffc7b50e4b Coding Standards: Improve organization of the WPCS-based PHPCS ruleset.
This commit:
* Adds section headers to the ruleset file.
* Organizes all directives in their respective sections.

No functional changes.

Props jrf.
See #59161.

git-svn-id: https://develop.svn.wordpress.org/trunk@56593 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-15 09:06:23 +00:00
Greg Ziółkowski
fd894bfd2c Blocks: Remove the gutenberg textdomain accidently added to translation
Props soean.
See #59346.
Follow-up [56587].



git-svn-id: https://develop.svn.wordpress.org/trunk@56592 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-15 07:49:27 +00:00
Joe Dolson
227fdb8b74 Media: Fix focus loss when closing Image Rotation menu.
Only shift focus into menu when opening the menu. Check `aria-expanded` value of toggle before moving focus.

Props joedolson.
Fixes #59353.

git-svn-id: https://develop.svn.wordpress.org/trunk@56591 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-14 22:33:50 +00:00
Joe Dolson
73d839264f Administration: additional_classes is not a function.
Correct usage of `additional_classes` array parameter as if it were a function. Clearly, I'm getting tired and missing things. So many little changes. Follow up to [56573].

Props joedolson.
See #57791.

git-svn-id: https://develop.svn.wordpress.org/trunk@56590 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-14 22:08:27 +00:00
Joe Dolson
bd8ff4a62a Administration: Fix undeclared variable.
Moved `$updated_notice_args` to be defined before the conditional in which it's used.

Props TobiasBg.
See #57791.

git-svn-id: https://develop.svn.wordpress.org/trunk@56589 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-14 17:10:25 +00:00
Greg Ziółkowski
da28362ba1 Tests: Improve the assertions for REST API endpoint for block types
Follow-up to [56587], [55673]. While working on #59346, it was noted that selectors fiels is not always included in the assertions. While looking at it is was difficult to spot the issue because the random order of how REST API fields where listed.

Reorderd the REST API fields in the test cases to follow the list from the documentation: https://github.com/WordPress/gutenberg/blob/trunk/docs/reference-guides/block-api/block-metadata.md. This way it's going to be easier to maintain the list moving forward.

Props ockham.
See #59346, #59313, #57585.



git-svn-id: https://develop.svn.wordpress.org/trunk@56588 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-14 14:54:41 +00:00
Bernie Reiter
7b90f22573 General: Add block_hooks field to block type registration, REST API.
In order to implement Block Hooks, we need to add a new `block_hooks` field to the `WP_Block_Type` class, as well as to block registration related functions, the block types REST API controller, etc.

Props gziolo.
Fixes #59346. See #59313.

git-svn-id: https://develop.svn.wordpress.org/trunk@56587 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-14 13:23:13 +00:00
Sergey Biryukov
e005108fe1 Coding Standards: Restore more descriptive variable names in a few class methods.
When various methods parameters in child classes were renamed to `$item` to match the parent class for PHP 8 named parameter support, most of the methods restored the more descriptive, specific name at the beginning for better readability, with several exceptions for methods consisting only of a few lines.

To avoid confusion about why some methods do that and some don't, this commit aims to bring more consistency to the code, specifically in list tables' `::column_default()` methods.

Follow-up to [51728], [51737], [51786].

See #58831.

git-svn-id: https://develop.svn.wordpress.org/trunk@56586 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-14 12:44:23 +00:00
Jonny Harris
4ba29eb1cb Taxonomy: Introduce 'cache_results' parameter to WP_Term_Query for bypassing query caching.
Incorporating a new 'cache_results' parameter into the WP_Term_Query class, this commit empowers developers with the ability to bypass query caches, explicitly triggering database queries when needed.  This brings the `WP_Term_Query` class inline with `WP_Query` and `WP_User_Query` that already have a 'cache_results' parameter.

Update the `term_exists` function to use this new parameter, so the term query caches are not used while importing. 

Props dlh, spacedmonkey, peterwilsoncc.
Fixes #52710.

git-svn-id: https://develop.svn.wordpress.org/trunk@56585 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-14 12:38:04 +00:00
Greg Ziółkowski
950e76270f Tests: Split tests for _inject_theme_attribute_in_template_part_block
Follow-up to [56578].
See #59338.



git-svn-id: https://develop.svn.wordpress.org/trunk@56584 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-14 11:45:51 +00:00
Jonny Harris
a5bcf199a7 Bundled Theme: Implement the_header_image_tag function for enhanced compatibility for older core themes.
The `the_header_image_tag` function was introduced in WordPress 4.4 as part of [35594]. It is used in all themes created post WordPress 4.4 that supported header images. The function `get_header_image_tag` continues to get updated with new image features, like lazy loading, async decoding and fetch priority. To ensure our core themes maintain compatibility and benefit from these enhancements, a backward compatibility shim has been applied, integrating the `the_header_image_tag` function into the following core themes:

- Twenty Ten
- Twenty Eleven
- Twenty Twelve
- Twenty Fourteen
- Twenty Sixteen

This change ensures future compatibility and modern image features are applied for header images to these older themes. 

Props spacedmonkey, flixos90, mukesh27.
Fixes #58675.

git-svn-id: https://develop.svn.wordpress.org/trunk@56583 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-14 11:23:59 +00:00
Tammie Lister
943e2b9551 Twenty Ninteen: Revert changes to 'style-rtl.css'.
This revert changes to Twenty Nineteen 'style-rtl.css' file made in [56580] as it auto-generated during the build process.

Unprops karmatosed.
Props costdev.
See #58443.


git-svn-id: https://develop.svn.wordpress.org/trunk@56581 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-14 10:23:55 +00:00
Tammie Lister
73053994bf Twenty Nineteen: Fixes button line height.
Line height was broken for button block and adding spacing.

Props nidhidhandhukiya, shailu25.
Fixes #58443.


git-svn-id: https://develop.svn.wordpress.org/trunk@56580 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-14 09:45:48 +00:00
Bernie Reiter
18fbb97e50 Themes: Fix @covers PHPDoc line for test.
Follow-up to [56578].
Props @mukesh27.
See #59338.

git-svn-id: https://develop.svn.wordpress.org/trunk@56579 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-14 09:04:04 +00:00
Bernie Reiter
bbb85de12d Themes: Inject theme attribute during serialization.
Rather than using `_inject_theme_attribute_in_block_template_content` to inject the `theme` attribute into all Template Part blocks found in a given file-based Block Template, introduce a new function called `_inject_theme_attribute_in_template_part_block`, and use that as second argument to `serialize_blocks()` (introduced in [56557]) in order to inject said attribute during tree traversal for serialization.

This allows for a more modular approach that will eventually be extended to implement automatic insertion of hooked blocks.

Note that we're guarding `_build_block_template_result_from_file()` (i.e. the callsite of `_inject_theme_attribute_in_template_part_block` and previously of `_inject_theme_attribute_in_block_template_content`) against regressions through additional unit test coverage added in [56562].

Props @gziolo.
Fixes #59338. See #59313.

git-svn-id: https://develop.svn.wordpress.org/trunk@56578 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-14 08:50:43 +00:00
Isabel Brison
11c53d559b Post Types: allow trashing draft patterns.
Adds `delete_posts` to capabilities for the `wp_block` post type.

Props ramonopoly, johnbillion, dhruvishah2203, audrasjb.
Fixes #59041.


git-svn-id: https://develop.svn.wordpress.org/trunk@56577 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-14 05:51:09 +00:00
Colin Stewart
4bdca50d7a Administration: Fix erroneous call to wp_admin().
In [56573], a typo caused `wp_admin()` to be called rather than `wp_admin_notice()`.

This fixes the typo to correctly call `wp_admin_notice()`.

Follow-up to [56573].

Props takayukister.
See #57791.

git-svn-id: https://develop.svn.wordpress.org/trunk@56576 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-14 05:48:41 +00:00
Isabel Brison
ec47a8f85f REST API: quality tweaks to WP_REST_Global_Styles_Controller.
Removes redundant local variable and changes validate_custom_css() access modifier from private to protected.

Props ramonopoly, spacedmonkey.
Fixes #59296.



git-svn-id: https://develop.svn.wordpress.org/trunk@56575 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-14 05:11:50 +00:00