apply_filters( 'widget_types_to_hide_from_legacy_widget_block', array $widgets )

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


Description Description

Returning an empty array will make all widgets available.


Top ↑

Parameters Parameters

$widgets

(array) An array of excluded widget-type IDs.


Top ↑

Source Source

File: wp-includes/block-editor.php

View on Trac



Top ↑

Changelog Changelog

Changelog
Version Description
5.8.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

  1. Skip to note 1 content
    Contributed by Ian Sackofwits

    In version 5.8, the following widgets are hidden from the 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',
    		)

    To make all of them visible, the following code can be used:

    add_filter( 'widget_types_to_hide_from_legacy_widget_block','__return_empty_array' );
    

You must log in before being able to contribute a note or feedback.