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

Remove panels from the block editor sidebar #123

Open
bueltge opened this issue Nov 8, 2019 · 0 comments
Open

Remove panels from the block editor sidebar #123

bueltge opened this issue Nov 8, 2019 · 0 comments

Comments

@bueltge
Copy link
Collaborator

bueltge commented Nov 8, 2019

Since Gutenberg is our new editor we get a lot of sidebar panels for the option of the different blocks. Maybe we should add a setting area for remove these panels from the sidebar.

Maybe we should set a whitelist to list only what we set.

// Visible
add_filter( 'allowed_block_types', function() {
  return [
    'core/heading',
    'core/paragraph',
    'core/image'
  ];
} );

Example to remove the 'featured-image' panel.

wp.domReady( () => {
	const { removeEditorPanel } = wp.data.dispatch('core/edit-post');

	// Remove featured image panel from sidebar.
	removeEditorPanel( 'featured-image' );
} );

List of all default blocks: https://github.com/WordPress/gutenberg/tree/master/packages/block-library/src

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant