Title: get_legacy_widget_block_editor_settings
Published: July 20, 2021
Last modified: May 20, 2026

---

# get_legacy_widget_block_editor_settings(): array

## In this article

 * [Return](https://developer.wordpress.org/reference/functions/get_legacy_widget_block_editor_settings/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/get_legacy_widget_block_editor_settings/?output_format=md#source)
 * [Hooks](https://developer.wordpress.org/reference/functions/get_legacy_widget_block_editor_settings/?output_format=md#hooks)
 * [Related](https://developer.wordpress.org/reference/functions/get_legacy_widget_block_editor_settings/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/get_legacy_widget_block_editor_settings/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/get_legacy_widget_block_editor_settings/?output_format=md#wp--skip-link--target)

Returns the block editor settings needed to use the Legacy Widget block which is
not registered by default.

## 󠀁[Return](https://developer.wordpress.org/reference/functions/get_legacy_widget_block_editor_settings/?output_format=md#return)󠁿

 array Settings to be used with [get_block_editor_settings()](https://developer.wordpress.org/reference/functions/get_block_editor_settings/).

## 󠀁[Source](https://developer.wordpress.org/reference/functions/get_legacy_widget_block_editor_settings/?output_format=md#source)󠁿

    ```php
    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;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/block-editor.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/block-editor.php#L247)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/block-editor.php#L247-L283)

## 󠀁[Hooks](https://developer.wordpress.org/reference/functions/get_legacy_widget_block_editor_settings/?output_format=md#hooks)󠁿

 [apply_filters( ‘widget_types_to_hide_from_legacy_widget_block’, string[] $widgets )](https://developer.wordpress.org/reference/hooks/widget_types_to_hide_from_legacy_widget_block/)

Filters the list of widget-type IDs that should **not** be offered by the Legacy
Widget block.

## 󠀁[Related](https://developer.wordpress.org/reference/functions/get_legacy_widget_block_editor_settings/?output_format=md#related)󠁿

| Uses | Description | 
| [apply_filters()](https://developer.wordpress.org/reference/functions/apply_filters/)`wp-includes/plugin.php` |

Calls the callback functions that have been added to a filter hook.

  |

| Used by | Description | 
| [WP_Customize_Widgets::enqueue_scripts()](https://developer.wordpress.org/reference/classes/wp_customize_widgets/enqueue_scripts/)`wp-includes/class-wp-customize-widgets.php` |

Enqueues scripts and styles for Customizer panel and export data to JavaScript.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/get_legacy_widget_block_editor_settings/?output_format=md#changelog)󠁿

| Version | Description | 
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_legacy_widget_block_editor_settings%2F)
before being able to contribute a note or feedback.