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

Only register widgets-related blocks in widgets-related contexts (server side) #26156

Open
adamziel opened this issue Oct 15, 2020 · 4 comments
Labels
[Block] Legacy Widget Affects the Legacy Widget Block - used for displaying Classic Widgets [Feature] Widgets Screen The block-based screen that replaced widgets.php. Needs Dev Ready for, and needs developer efforts [Package] Edit Widgets /packages/edit-widgets [Type] Code Quality Issues or PRs that relate to code quality

Comments

@adamziel
Copy link
Contributor

Since legacy-widget and widget-area blocks are only registered in the widgets editor client-side, it would make sense to do the same server-side.

@adamziel adamziel added [Feature] Widgets Screen The block-based screen that replaced widgets.php. [Block] Legacy Widget Affects the Legacy Widget Block - used for displaying Classic Widgets [Package] Edit Widgets /packages/edit-widgets labels Oct 15, 2020
@adamziel adamziel added this to Inbox in Block-based Widgets Editor via automation Oct 15, 2020
@adamziel adamziel changed the title Only register widgets-related block in widget context (server side) Only register widgets-related blocks in widgets-related contexts (server side) Oct 15, 2020
@talldan talldan moved this from Inbox to Needs dev in Block-based Widgets Editor Jan 6, 2021
@draganescu
Copy link
Contributor

Is this fixing this?

@noisysocks noisysocks moved this from Needs dev to Maybe later in Block-based Widgets Editor Jun 25, 2021
@skorasaurus
Copy link
Member

Is this fixing this?

maybe? with a gutenberg built from trunk earlier today; legacy widget appeared in the inserter at wp-admin/themes.php?page=gutenberg-widgets but it did not appear in the inserter when I created a new page.

@noisysocks
Copy link
Member

No, this isn't fixed. We require the block PHP regardless of what screen is being shown.

Here in Core:

https://github.com/WordPress/wordpress-develop/blob/26722b77624fc755e3fcb721d2ce530abc777bd6/src/wp-includes/blocks/index.php#L18

Here in the plugin:

require_once $blocks_dir . $file;

@noisysocks noisysocks added [Type] Code Quality Issues or PRs that relate to code quality Needs Dev Ready for, and needs developer efforts labels Feb 4, 2022
@noisysocks
Copy link
Member

It's a pretty minor issue as it doesn't really affect anything to my knowledge. Still, gotta shave those yaks.

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 [Feature] Widgets Screen The block-based screen that replaced widgets.php. Needs Dev Ready for, and needs developer efforts [Package] Edit Widgets /packages/edit-widgets [Type] Code Quality Issues or PRs that relate to code quality
Projects
No open projects
Development

No branches or pull requests

4 participants