Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Widgets Screen: Suppress the Legacy Widget block when no 3rd party widgets installed. #26240

Open
garretthyder opened this issue Oct 17, 2020 · 3 comments
Labels
[Block] Legacy Widget Affects the Legacy Widget Block - used for displaying Classic Widgets Needs Dev Ready for, and needs developer efforts [Type] Enhancement A suggestion for improvement.

Comments

@garretthyder
Copy link
Contributor

Is your feature request related to a problem? Please describe.
The Legacy Widget block is used to provide a dropdown allowing 3rd party widgets. When there's none available it can be added but will display a 'There are no widgets available' message.

Describe the solution you'd like
It would be nice to simply suppress the block when there's no 3rd party widgets available. If there are some and get removed we can leave the block with the existing message. But we should just suppress when it's has no application.

Screen Shot 2020-10-17 at 12 21 31 AM

@talldan talldan added [Feature] Widgets Screen The block-based screen that replaced widgets.php. [Type] Enhancement A suggestion for improvement. labels Oct 19, 2020
@talldan
Copy link
Contributor

talldan commented Feb 19, 2021

As mentioned on #29018, a user might have some Legacy Widgets (e.g. Recent Posts) that are already added to a widget area (converted from widgets to blocks), but they then can't add more of that type to a widget area.

I understand the reasons why, but this is a little confusing. Not sure if there's a better way to handle it.

@noisysocks
Copy link
Member

Haven't investigated this but we may be able to do this simply by setting supports.inserter to false on the core/legacy-widget block when there are no widgets which can be selected.

@noisysocks noisysocks added Needs Dev Ready for, and needs developer efforts [Block] Legacy Widget Affects the Legacy Widget Block - used for displaying Classic Widgets and removed [Feature] Widgets Screen The block-based screen that replaced widgets.php. labels Jan 27, 2022
@noisysocks
Copy link
Member

Could potentially use blockEditor.__unstableCanInsertBlockType for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Legacy Widget Affects the Legacy Widget Block - used for displaying Classic Widgets Needs Dev Ready for, and needs developer efforts [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

3 participants