Skip to content

Remove panels from the block editor sidebar #123

@bueltge

Description

@bueltge

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions