-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add block-based widgets editor #1284
Conversation
1dc94ed
to
2c74335
Compare
0e59af9
to
b62af1c
Compare
1116dbd
to
7dcbf65
Compare
Not sure why tests on PHP 8 are hanging. It seems to be happening on all branches. I verified locally that tests pass using PHP 8. |
7dcbf65
to
3b06789
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, and works well ✅ Left a few questions below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this landed already but I left a few comments that might or might not result in follow-up commits :)
Trac ticket: https://core.trac.wordpress.org/ticket/51506
Supersedes #603.
Requires #1293.
This moves the the block-based widget editors over from Gutenberg into Core.
Broadly speaking, there's four parts to this:
@wordpress/edit-widgets
,@wordpress/customize-widgets
, and@wordpress/widgets
are added as dependencies. These packages contain the block editors.Supporting infrastructure such as
WP_Widget_Block
has been copied over from Gutenberg.wp-admin/widgets.php
has been modified to branch between the old form-based editorwp-admin/widgets-form.php
and the new block-based editorwp-admin/widgets-form-blocks.php
depending onget_theme_support( 'widgets-block-editor' )
anduse_widgets_block_editor
.WP_Customize_Widgets
has been modified to useWP_Sidebar_Block_Editor_Control
which contains the block editor instead ofWP_Widget_Area_Customize_Control
depending onget_theme_support( 'widgets-block-editor' )
anduse_widgets_block_editor
.This PR contains
WP_REST_Sidebars_Controller
andWP_REST_Widget_Utils_Controller
so that it's easier to test, but these parts should be committed separately. @TimothyBJacobs is working on it.How to test
npm run env:start
npm run env:install
npm run dev
widgets.php
block editor.customize.php
block editor.Tasks remaining
WP_Customize_Widgets::enqueue_scripts
can be skipped if block editor is enabled.should_load_block_editor_scripts_and_styles
filter is not run in Customizer.This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.