adminimize icon indicating copy to clipboard operation
adminimize copied to clipboard

Remove panels from the block editor sidebar

Open bueltge opened this issue 6 years ago • 0 comments

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

bueltge avatar Nov 08 '19 09:11 bueltge