Plugin: Backport PHP changes for WordPress 6.1 release
Description
Related Trac ticket 56467.
This is the tracking issue to coordinate the process of backporting all PHP changes added in the Gutenberg plugin that needs to be backported for the WordPress 6.1 release.
Files listed for WP 6.1
lib/block-supports
- [x] ~
border.php~ https://github.com/WordPress/wordpress-develop/pull/3204 π’ - [x] ~
colors.php~ https://github.com/WordPress/wordpress-develop/pull/3204 π’ - [x] ~
dimensions.php~ No changes since WP 6.0. - [x] ~
duotone.php~ https://github.com/WordPress/wordpress-develop/pull/3210 π’ - [x] ~
elements.php~ https://github.com/WordPress/wordpress-develop/pull/3204 π’ - [x] ~
layout.php~ @andrewserong (ref). Blocked by https://github.com/WordPress/wordpress-develop/pull/3212 and https://github.com/WordPress/wordpress-develop/pull/2928. https://github.com/WordPress/wordpress-develop/pull/3199 https://github.com/WordPress/wordpress-develop/pull/3254 π’ - [x] ~
spacing.php~ https://github.com/WordPress/wordpress-develop/pull/3204 π’ - [x] ~
typography.php~ https://github.com/WordPress/wordpress-develop/pull/3203 π’ - [x] ~
utils.php~ No changes since WP 6.0.
lib/compat/wordpress-6.1
- [x] ~
block-editor-settings.php~ - Layout: #42906 Spacing: #42173 π’ - [ ]
block-patterns.php- π΄ Patterns registered in this file are not in Core. - [x] ~
block-template-utils.php~ Site editor: #3214 π’ - [ ]
blocks.phpπ΄ It seems that the multipleviewScriptsfeature has not been backported. - [x] ~
class-gutenberg-rest-block-patterns-controller.php~ No changes since WP 6.0. - [x] ~
class-gutenberg-rest-templates-controller.php~ No changes since WP 6.0. - [x] ~
class-wp-theme-json-6-1.php~ https://github.com/WordPress/wordpress-develop/pull/3206 https://github.com/WordPress/wordpress-develop/pull/3205 https://github.com/WordPress/wordpress-develop/pull/3255 π’ - [x] ~
class-wp-theme-json-resolver-6-1.php~ https://github.com/WordPress/wordpress-develop/pull/3255 β οΈ Core has more 6.1 functions than the Gutenberg file. - [x] ~
date-settings.php~ Code is already in Core π’ - [x] ~
edit-form-blocks.php~ https://github.com/WordPress/wordpress-develop/pull/3156 @Mamaduka π’ - [x] ~
get-global-styles-and-settings.php~ π’ - [x] ~
persisted-preferences.php~ https://github.com/WordPress/wordpress-develop/pull/3219 π’ - [x] ~
rest-api.php~ π’ - [x] ~
script-loader.php~ Style engine changes in WordPress/wordpress-develop#3218 π’ - [ ]
theme-i18n.jsonπ΄ - [x] ~
theme.json~ https://github.com/WordPress/wordpress-develop/pull/3205 π’ - [x] ~
theme.php~ @andrewserong Should be covered by layout related work. Only affected by https://github.com/WordPress/gutenberg/pull/42544. π’ - [x] ~
wp-theme-get-post-templates.php~ (No need to backport, see https://github.com/WordPress/gutenberg/issues/43440#issuecomment-1228285020.)
lib/experimental
- [x] ~
block-editor-settings-mobile.php~ No need to backport: Only used for mobile editor. @geriux confirmed that the endpoint is only available from the GB plugin for now. - [x] ~
blocks.php~ Deleted. - [ ]
class-wp-rest-block-editor-settings-controller.php - [ ]
class-wp-rest-customizer-nonces.php - [x] ~
class-wp-theme-json-gutenberg.php~ No need to backport -- "alias" wrapper aroundWP_Theme_JSON_6_1. - [ ]
class-wp-theme-json-resolver-gutenberg.php - [ ]
class-wp-webfonts-provider-local.php - [ ]
class-wp-webfonts-provider.php - [ ]
class-wp-webfonts.php - [ ]
editor-settings.php - [ ]
navigation-page.php - [ ]
navigation-theme-opt-in.php - [ ]
register-webfonts-from-theme-json.php - [ ]
rest-api.php - [ ]
webfonts.php
Legend:
π’ β confirmed for WP 6.1 π‘ β needs decision π΄ β moved to future WP release
Getting Involved
If you are interested in helping with the effort, can you comment (or edit the issue's description) with your name next to the file if you plan to help with backporting. It would also help to link to Track issues / GitHub PRs in WordPress core when they are available.
Action items when working on backports:
- Update the files to follow best practices. Mostly rename functions/classes to use
wp_prefix instead ofgutenberg_and guard with declaration checks for code that needs to be backported to WordPress core. - Identify files and functionality that need to be backported to WordPress core.
- Ensure all files, classes, methods, properties, and functions have
@since 6.1.0documentation tag included. - Ensure all functionality backported to WordPress core has unit tests written.
Note that @hellofromtonya has started work to smoothen the backporting process, by adjusting Gutenberg's test and lint structure to more closely resemble Core's (to avoid having to fix code in backport PRs when they don't pass wordpress-develop's tests even though they did pass Gutenberg's): #43333
Issue modeled after #39889.
I'll create a patch for changes in edit-form-blocks.php file.
The gutenberg_add_site_icon_url_to_index feature backport from rest-api.php depends if we merge #43514 or not.
@ntsekouras, correct me if I'm wrong, but the wp-theme-get-post-templates.php doesn't need to be ported into the core.
Heads-up that I opened a PR in wordpress-develop: https://github.com/WordPress/wordpress-develop/pull/3131 which implements the same fix as #43597 in block-template-utils.php.
Related track issue: https://core.trac.wordpress.org/ticket/55881#ticket
@ntsekouras, correct me if I'm wrong, but the wp-theme-get-post-templates.php doesn't need to be ported into the core.
Good catch @Mamaduka ! It seems so.
Apologies for the mass ping -- I'd like to get the backports work off the ground π
tl;dr: If you've added PHP code to Gutenberg's lib/ directory since the WP 6.0 release, it will need backporting to wordpress-develop in order to be included in WP 6.1. Backporting is typically easiest for the people who originally implemented the relevant feature. Please refer to the list in the issue description and leave a comment if you're willing to backport code. If you're unfamiliar with the process of backporting, don't hesitate to ping me (@ockham) or @michalczaplinski -- we're happy to help!
PRs that are strickenthrough are already merged in WordPress Core
lib/block-supports/
-
- #42719
- #42140
- #42113
- ~~#41527~~
- #40531
- #37770 @ramonjd @glendaviesnz @aaronrobertshaw
-
- #42719
- #42140
- #42113
- #40332 @ramonjd
-
- ~~#42020~~
- ~~#39564~~ @jorgefilipecosta @ajlende
-
- #43103
- #42878
- #42452
- #42719
- #42140
- #42113
- #40987
- #40594
- ~~#37728~~ @ramonjd @oandregal @scruffian
-
- #43103
- #43052
- #42970
- #42939
- #42878
- #42452
- ~~#42544~~
- #42719
- ~~#42085~~
- ~~#40875~~
- #41306
- #41885
- #41487
- #41098
- #41018 @ramonjd @aristath @matiasbenedetto @andrewserong @tellthemachines @youknowriad @glendaviesnz
-
- #42719
- #42140
- #42113
- ~~#41527~~
- #40332 @ramonjd @glendaviesnz
-
- #42757
- #42719
- #42688
- ~~#39529~~
- #42140
- #42113
- #40332 @ramonjd
lib/compat/wordpress-6.1/
-
block-editor-settings.php
- #42173
- #42906
- #42818
- ~~#42544~~
- ~~#40875~~
- ~~#41527~~
- #40818
- ~~#40185~~ @glendaviesnz @andrewserong @Soean @jsnajdr @oandregal
-
block-patterns.php
- #41791 @jorgefilipecosta
-
block-template-utils.php
- #42520
- #42586
- #41387
- ~~#41302~~ @ntsekouras
-
blocks.php
- #43004
- ~~#40875~~
- #40136
- #40349 @andrewserong @aristath @gziolo
-
class-gutenberg-rest-block-patterns-controller.php
- #41791
- #40902
- #40416
- #40259
- #40265
- #40254
- ~#40252~ (This is a "back-backport" from Core.) @jorgefilipecosta @anton-vlasenko @Mamaduka @ntsekouras @gziolo @jsnajdr
-
class-gutenberg-rest-templates-controller.php
- #42520
- #41189
- #41387 @ntsekouras
-
class-wp-theme-json-6-1.php
- #43167
- ~~#43105~~
- #43088
- ~~#43101~~
- #42776
- ~~#42544~~
- ~~#42665~~
- #42669
- ~~#39529~~
- ~~#42085~~
- ~~#42087~~
- ~~#40875~~
- ~~#41981~~
- #42096
- #42072
- ~~#41527~~
- ~~#41140~~
- #41696
- #41786
- #41822
- #41753
- ~~#41335~~
- ~~#41240~~
- ~~#41217~~
- #40260
- ~~#41160~~
- #40889 @Mamaduka @glendaviesnz @MaggieCabrera @scruffian @andrewserong @ramonjd @tellthemachines @aaronrobertshaw @getdave @matiasbenedetto @torounit
-
class-wp-theme-json-resolver-6-1.php
- #41306
- ~~#41527~~
- #41822 @youknowriad @glendaviesnz @scruffian
-
date-settings.php
- #41648 @noisysocks
-
edit-form-blocks.php
- #42413
- ~~#42209~~ @Mamaduka
-
get-global-styles-and-settings.php
- ~~#40875~~
- #42005
- #41446
- ~~#41160~~ @andrewserong @scruffian @glendaviesnz
-
persisted-preferences.php
- #40637
- #39795 @talldan
-
rest-api.php
- ~~#42957~~
- #41791
- #41189
- #41387 @Mamaduka @jorgefilipecosta @ntsekouras
-
script-loader.php
- #42880
- #43073
- #42207
- #42005
- #41015
- ~~#41160~~ @ramonjd @scruffian @glendaviesnz
-
theme-i18n.json
- ~~#41527~~
- #40994 @glendaviesnz @gziolo
-
theme.json
- #42173
- #42053
- ~~#42085~~
- ~~#40875~~
- #42012
- ~~#41527~~
- #41934
- #41786
- #41822 @glendaviesnz @matiasbenedetto @tellthemachines @andrewserong @scruffian @getdave
-
theme.php
- ~~#42544~~ @andrewserong
lib/experimental/
-
block-editor-settings-mobile.php
- #42697
- #25892 @ellatrix @oandregal
-
- #42697
- #25892 @ellatrix @oandregal
-
class-wp-rest-block-editor-settings-controller.php
- #42173
- ~~#42544~~
- #42697
- ~~#41527~~ @glendaviesnz @andrewserong @ellatrix
-
class-wp-theme-json-gutenberg.php
- #42776
- #40889 @scruffian
-
class-wp-theme-json-resolver-gutenberg.php
- #42756
- #43337
List modeled after https://github.com/WordPress/gutenberg/issues/39889#issuecomment-1087604073. Created using the script from #43360.
I can take care of all the spacing size preset related changes.
@ockham, @michalczaplinski, do we have a core tracking ticket to reference in Core PRs?
@ockham, @michalczaplinski, do we have a core tracking ticket to reference in Core PRs?
@Mamaduka Ah, we didn't -- my apologies! I've filed one now: https://core.trac.wordpress.org/ticket/56467
I'm happy to help out with Layout backports. I'm travelling at the moment but can start looking at some of them next week when I'm back. Some of them might have a couple of challenges β layout.php currently depends on the style engine work in the style engine package (so just CCing @ramonjd there), which might need to land first?
Also, I was wondering how we deal with PHP changes that require JS changes to be shipped at the same time? I think some of the Layout work might need to happen all at once π€. There's definitely pieces that can be done in separate PRs first, though, so I'll give it a bit more thought to see what sort of order might work.
Just linking a couple of other pre-requisites for Layout in Gutenberg being merged to core:
- Trac ticket 55966, which adds in support for additional CSS functions to
safecss_filter_attr(likeclamp) - Core PR (https://github.com/WordPress/wordpress-develop/pull/2928) to add in layout related CSS properties to
safe_style_css_filter
I believe the above two tickets/PRs will need to land prior to the layout.php changes being backported.
@ockham,
My backport PRs are ready:
- https://github.com/WordPress/wordpress-develop/pull/3156
- https://github.com/WordPress/wordpress-develop/pull/3157
The https://github.com/WordPress/gutenberg/pull/40416 should already be in Core, cherry-picked for a minor release - https://github.com/WordPress/wordpress-develop/pull/2600.
I've only done a minor code quality work for class-wp-theme-json-6-1.php, but happy to help as needed.
Small update: In https://github.com/WordPress/wordpress-develop/pull/3154, I'm attempting a package sync to update Core to the latest package versions -- mostly as a dry-run for Beta 1. (I would like to actually merge it once its ready -- see its PR desc for context).
In order to unblock that PR, I've filed a small backport PR to add the $priority param to wp_enqueue_block_support_styles.
In order to unblock that PR, I've filed a small backport PR to add the
$priorityparam towp_enqueue_block_support_styles.
In addition to that, we need to refactor all occurrences of WP_Theme_JSON_Gutenberg and gutenberg_enqueue_block_support_styles in core blocks in the Gutenberg plugin. That might not be trivial as the plugin still supports WordPress 6.0 and 6.1 where some functionality is missing.
In order to unblock that PR, I've filed a small backport PR to add the
$priorityparam towp_enqueue_block_support_styles.In addition to that, we need to refactor all occurrences of
WP_Theme_JSON_Gutenbergandgutenberg_enqueue_block_support_stylesin core blocks in the Gutenberg plugin. That might not be trivial as the plugin still supports WordPress 6.0 and 6.1 where some functionality is missing.
Good point. Here's one approach for gutenberg_enqueue_block_support_styles: https://github.com/WordPress/gutenberg/pull/43779.
Thanks for the nice listβthat's a cool script! I've backported https://github.com/WordPress/gutenberg/pull/41648 (in r54079) and checked it off the list in the description.
I'm working on prepping packages/style-engine for inclusion in core.
WIP here: https://github.com/WordPress/wordpress-develop/pull/3199
This will unblock most of the lib/block-supports migrations given that they're using style engine methods.
It requires https://core.trac.wordpress.org/ticket/55966, otherwise I'll need to migrate gutenberg_safecss_filter_attr_allow_css_6_1 to core to make the Style Engine work. π±
It requires https://core.trac.wordpress.org/ticket/55966, otherwise I'll need to migrate gutenberg_safecss_filter_attr_allow_css_6_1 to core to make the Style Engine work. π±
I've asked in #core for someone to merge 55966's patch π
As the Feature Freeze is only two weeks away, I'll start pinging some folks who I know have good domain knowledge of certain areas and can help backporting some files π
@ntsekouras -- Could you file a backport PR for the changes you made to block-template-utils.php and class-gutenberg-rest-templates-controller.php? π
As the Feature Freeze is only two weeks away, I'll start pinging some folks who I know have good domain knowledge of certain areas and can help backporting some files π
@jorgefilipecosta -- Could you maybe file a backport PR for https://github.com/WordPress/gutenberg/pull/41791 (affecting block-patterns.php, class-gutenberg-rest-block-patterns-controller.php, and rest-api.php)? π
As the Feature Freeze is only two weeks away, I'll start pinging some folks who I know have good domain knowledge of certain areas and can help backporting some files π
@jorgefilipecosta -- Could you maybe file a backport PR for #41791 (affecting block-patterns.php, class-gutenberg-rest-block-patterns-controller.php, and rest-api.php)? π
Sure π
As the Feature Freeze is only two weeks away, I'll start pinging some folks who I know have good domain knowledge of certain areas and can help backporting some files π
@oandregal -- Could you maybe file a backport PR for #25892 (Quote v2)? π
I'm taking a look at persisted preferences.
I'm working on backporting the changes and additions to the Elements API here. The PR has a list of the PRs I'm backporting, the class-wp-theme-json-6-1.php file has other changes unrelated to elements that I won't be adding to said PR, this is the list of the PRs it's NOT going to include:
https://github.com/WordPress/gutenberg/pull/41217 https://github.com/WordPress/gutenberg/pull/41335 https://github.com/WordPress/gutenberg/pull/41527 https://github.com/WordPress/gutenberg/pull/40875 https://github.com/WordPress/gutenberg/pull/42087 https://github.com/WordPress/gutenberg/pull/42085 https://github.com/WordPress/gutenberg/pull/39529 https://github.com/WordPress/gutenberg/pull/42665 https://github.com/WordPress/gutenberg/pull/42544 https://github.com/WordPress/gutenberg/pull/43101 https://github.com/WordPress/gutenberg/pull/43105
- duotone.php
- https://github.com/WordPress/gutenberg/pull/42020
- https://github.com/WordPress/gutenberg/pull/39564
- class-wp-theme-json-6-1.php
- https://github.com/WordPress/gutenberg/pull/41335
I'm working on the duotone backports
EDIT: duotone.php is done in https://github.com/WordPress/wordpress-develop/pull/3210 and I've talked with @MaggieCabrera for the class-wp-theme-json-6-1.php changes because they depend on the Elements API backports.
:wave: sorry for the late response. I've looked at the pings but nothing needs backporting on my side:
-
elements.php- #37728 this has been backported for 6.0
-
block-editor-settings.php- https://github.com/WordPress/gutenberg/pull/40185 it has been backported for 6.0
-
lib/experimental/block-editor-settings-mobile.php#L18- we should not backport this until mobile confirms the endpoint goes to core, see context. cc @geriux
- the bits for list v2 have been removed
@ntsekouras -- Could you file a backport PR for the changes you made to block-template-utils.php and class-gutenberg-rest-templates-controller.php? π
I'll look at it, but we probably need to wait @jorgefilipecosta for a PR that updates some related logic there.
- https://github.com/WordPress/gutenberg/pull/41302 @ntsekouras
PR: https://github.com/WordPress/wordpress-develop/pull/3214
I will take a look at:
- https://github.com/WordPress/gutenberg/pull/41981
- https://github.com/WordPress/gutenberg/pull/41140
- https://github.com/WordPress/gutenberg/pull/41240
Backported in https://github.com/WordPress/wordpress-develop/pull/3215
Heads up that I think https://github.com/WordPress/wordpress-develop/pull/3199 (Style engine backport) is baked and ready to land. Thanks to @costdev for helping to prepare.
This wordpress-develop PR backports the following changes:
- https://github.com/WordPress/gutenberg/pull/42880
PR here for persisted preferences - https://github.com/WordPress/wordpress-develop/pull/3219.
I believe the above two tickets/PRs will need to land prior to the
layout.phpchanges being backported.
@andrewserong , those PR seems to be already merged. I guess we can keep going with layout.php. Thanks!!