Make WordPress Core


Ignore:
Timestamp:
05/25/2021 08:38:04 AM (4 years ago)
Author:
noisysocks
Message:

Adds the widgets block editor to widgets.php and customize.php

Moves the widgets block editor from Gutenberg into WordPress Core.

  • Adds @wordpress/edit-widgets, @wordpress/customize-widgets and @wordpress/widgets.
  • Modifies wp-admin/widgets.php to branch between the old editor and new editor depending on wp_use_widgets_block_editor().
  • Modifies WP_Customize_Widgets to branch between the old editor control and new editor control depending on wp_use_widgets_block_editor().

Fixes #51506.
Props isabel_brison, TimothyBlynJacobs, andraganescu, kevin940726, talldanwp.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/block-editor.php

    r50983 r50996  
    226226    }
    227227
     228    /**
     229     * Filters the list of widget-type IDs that should **not** be offered by the
     230     * Legacy Widget block.
     231     *
     232     * Returning an empty array will make all widgets available.
     233     *
     234     * @since 5.8.0
     235     *
     236     * @param array $widgets An array of excluded widget-type IDs.
     237     */
     238    $editor_settings['widgetTypesToHideFromLegacyWidgetBlock'] = apply_filters(
     239        'widget_types_to_hide_from_legacy_widget_block',
     240        array(
     241            'pages',
     242            'calendar',
     243            'archives',
     244            'media_audio',
     245            'media_image',
     246            'media_gallery',
     247            'media_video',
     248            'meta',
     249            'search',
     250            'text',
     251            'categories',
     252            'recent-posts',
     253            'recent-comments',
     254            'rss',
     255            'tag_cloud',
     256            'nav_menu',
     257            'custom_html',
     258            'block',
     259        )
     260    );
     261
    228262    return $editor_settings;
    229263}
Note: See TracChangeset for help on using the changeset viewer.