You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How we can allow only specific blocks for the new Widget Screen? #33238
the new widget screen will come to WordPress with the next release. Therefore it's very useful to disallow or allow specific block types only for using on a small width sidebar.
How we can deal with this?
Is there a filter like add_filter( 'allowed_block_types', '...') to allow specific block types for the widget screen?
Activity
noisysocks commentedon Jul 7, 2021
Hey @CreativeDive.
You can tell if the block editor is not the post block editor using something like this:
To tell if the block editor is the widgets block editor you could use something like this:
The latter example is a little hacky. We will look at improving this in 5.8.x, see #28517.