Skip to content
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

Widgets: Always enable Legacy Widget block and Widget REST APIs #24840

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion lib/experiments-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ function gutenberg_display_experiment_section() {
*/
function gutenberg_experiments_editor_settings( $settings ) {
$experiments_settings = array(
'__experimentalEnableLegacyWidgetBlock' => get_theme_support( 'widgets-block-editor' ),
'__experimentalEnableFullSiteEditing' => gutenberg_is_experiment_enabled( 'gutenberg-full-site-editing' ),
'__experimentalEnableFullSiteEditingDemo' => gutenberg_is_experiment_enabled( 'gutenberg-full-site-editing-demo' ),
);
Expand Down
12 changes: 4 additions & 8 deletions lib/rest-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,8 @@ function gutenberg_filter_rest_prepare_theme( $response, $theme, $request ) {
* @since 5.0.0
*/
function gutenberg_register_rest_widget_updater_routes() {
if ( get_theme_support( 'widgets-block-editor' ) ) {
$widget_forms = new WP_REST_Widget_Utils_Controller();
$widget_forms->register_routes();
}
$widget_forms = new WP_REST_Widget_Utils_Controller();
$widget_forms->register_routes();
}
add_action( 'rest_api_init', 'gutenberg_register_rest_widget_updater_routes' );

Expand Down Expand Up @@ -194,10 +192,8 @@ function gutenberg_register_plugins_endpoint() {
* Registers the Sidebars REST API routes.
*/
function gutenberg_register_sidebars_endpoint() {
if ( get_theme_support( 'widgets-block-editor' ) ) {
$sidebars = new WP_REST_Sidebars_Controller();
$sidebars->register_routes();
}
$sidebars = new WP_REST_Sidebars_Controller();
$sidebars->register_routes();
}
add_action( 'rest_api_init', 'gutenberg_register_sidebars_endpoint' );

Expand Down
1 change: 0 additions & 1 deletion packages/block-editor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,6 @@ _Properties_
- _titlePlaceholder_ `string`: Empty title placeholder
- _codeEditingEnabled_ `boolean`: Whether or not the user can switch to the code editor
- _\_\_experimentalCanUserUseUnfilteredHTML_ `boolean`: Whether the user should be able to use unfiltered HTML or the HTML should be filtered e.g., to remove elements considered insecure like iframes.
- _\_\_experimentalEnableLegacyWidgetBlock_ `boolean`: Whether the user has enabled the Legacy Widget Block
- _\_\_experimentalBlockDirectory_ `boolean`: Whether the user has enabled the Block Directory
- _\_\_experimentalEnableFullSiteEditing_ `boolean`: Whether the user has enabled Full Site Editing
- _\_\_experimentalEnableFullSiteEditingDemo_ `boolean`: Whether the user has enabled Full Site Editing Demo Templates
Expand Down
2 changes: 0 additions & 2 deletions packages/block-editor/src/store/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export const PREFERENCES_DEFAULTS = {
* @property {string} titlePlaceholder Empty title placeholder
* @property {boolean} codeEditingEnabled Whether or not the user can switch to the code editor
* @property {boolean} __experimentalCanUserUseUnfilteredHTML Whether the user should be able to use unfiltered HTML or the HTML should be filtered e.g., to remove elements considered insecure like iframes.
* @property {boolean} __experimentalEnableLegacyWidgetBlock Whether the user has enabled the Legacy Widget Block
* @property {boolean} __experimentalBlockDirectory Whether the user has enabled the Block Directory
* @property {boolean} __experimentalEnableFullSiteEditing Whether the user has enabled Full Site Editing
* @property {boolean} __experimentalEnableFullSiteEditingDemo Whether the user has enabled Full Site Editing Demo Templates
Expand Down Expand Up @@ -153,7 +152,6 @@ export const SETTINGS_DEFAULTS = {
availableLegacyWidgets: {},
hasPermissionsToManageWidgets: false,
__experimentalCanUserUseUnfilteredHTML: false,
__experimentalEnableLegacyWidgetBlock: false,
__experimentalBlockDirectory: false,
__experimentalEnableFullSiteEditing: false,
__experimentalEnableFullSiteEditingDemo: false,
Expand Down
7 changes: 2 additions & 5 deletions packages/block-library/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,14 +187,11 @@ export const registerCoreBlocks = () => {
export const __experimentalRegisterExperimentalCoreBlocks =
process.env.GUTENBERG_PHASE === 2
? ( settings ) => {
const {
__experimentalEnableLegacyWidgetBlock,
__experimentalEnableFullSiteEditing,
} = settings;
const { __experimentalEnableFullSiteEditing } = settings;

[
widgetArea,
__experimentalEnableLegacyWidgetBlock ? legacyWidget : null,
legacyWidget,
navigation,
navigationLink,

Expand Down
1 change: 0 additions & 1 deletion packages/editor/src/components/provider/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ class EditorProvider extends Component {
'__experimentalBlockPatterns',
'__experimentalBlockPatternCategories',
'__experimentalEnableCustomSpacing',
'__experimentalEnableLegacyWidgetBlock',
'__experimentalEnableLinkColor',
'__experimentalEnableFullSiteEditing',
'__experimentalEnableFullSiteEditingDemo',
Expand Down
1 change: 0 additions & 1 deletion test/integration/full-content/full-content.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ describe( 'full post content fixture', () => {
);
unstable__bootstrapServerSideBlockDefinitions( blockDefinitions );
const settings = {
__experimentalEnableLegacyWidgetBlock: true,
__experimentalEnableFullSiteEditing: true,
};
// Load all hooks that modify blocks
Expand Down