get_legacy_widget_block_editor_settings

The timeline below displays how wordpress function get_legacy_widget_block_editor_settings has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 5.9

/**
 * Returns the block editor settings needed to use the Legacy Widget block which
 * is not registered by default.
 *
 * @since 5.8.0
 *
 * @return array Settings to be used with get_block_editor_settings().
 */
function get_legacy_widget_block_editor_settings()
{
    $editor_settings = array();
    /**
     * Filters the list of widget-type IDs that should **not** be offered by the
     * Legacy Widget block.
     *
     * Returning an empty array will make all widgets available.
     *
     * @since 5.8.0
     *
     * @param string[] $widgets An array of excluded widget-type IDs.
     */
    $editor_settings['widgetTypesToHideFromLegacyWidgetBlock'] = apply_filters('widget_types_to_hide_from_legacy_widget_block', array('pages', 'calendar', 'archives', 'media_audio', 'media_image', 'media_gallery', 'media_video', 'search', 'text', 'categories', 'recent-posts', 'recent-comments', 'rss', 'tag_cloud', 'custom_html', 'block'));
    return $editor_settings;
}

WordPress Version: 5.8

/**
 * Returns the block editor settings needed to use the Legacy Widget block which
 * is not registered by default.
 *
 * @since 5.8.0
 *
 * @return array Settings to be used with get_block_editor_settings().
 */
function get_legacy_widget_block_editor_settings()
{
    $editor_settings = array();
    /**
     * Filters the list of widget-type IDs that should **not** be offered by the
     * Legacy Widget block.
     *
     * Returning an empty array will make all widgets available.
     *
     * @since 5.8.0
     *
     * @param array $widgets An array of excluded widget-type IDs.
     */
    $editor_settings['widgetTypesToHideFromLegacyWidgetBlock'] = apply_filters('widget_types_to_hide_from_legacy_widget_block', array('pages', 'calendar', 'archives', 'media_audio', 'media_image', 'media_gallery', 'media_video', 'search', 'text', 'categories', 'recent-posts', 'recent-comments', 'rss', 'tag_cloud', 'custom_html', 'block'));
    return $editor_settings;
}