-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Add block-based widgets editor #1284
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
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
tellthemachines
left a comment
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.
youknowriad
left a comment
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/widgetsare added as dependencies. These packages contain the block editors.Supporting infrastructure such as
WP_Widget_Blockhas been copied over from Gutenberg.wp-admin/widgets.phphas been modified to branch between the old form-based editorwp-admin/widgets-form.phpand the new block-based editorwp-admin/widgets-form-blocks.phpdepending onget_theme_support( 'widgets-block-editor' )anduse_widgets_block_editor.WP_Customize_Widgetshas been modified to useWP_Sidebar_Block_Editor_Controlwhich contains the block editor instead ofWP_Widget_Area_Customize_Controldepending onget_theme_support( 'widgets-block-editor' )anduse_widgets_block_editor.This PR contains
WP_REST_Sidebars_ControllerandWP_REST_Widget_Utils_Controllerso that it's easier to test, but these parts should be committed separately. @TimothyBJacobs is working on it.How to test
npm run env:startnpm run env:installnpm run devwidgets.phpblock editor.customize.phpblock editor.Tasks remaining
WP_Customize_Widgets::enqueue_scriptscan be skipped if block editor is enabled.should_load_block_editor_scripts_and_stylesfilter 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.