wp-media / adminimize

Adminimize is a WordPress plugin that lets you hide 'unnecessary' items from the WordPress backend.
https://wordpress.org/plugins/adminimize/
GNU General Public License v2.0
100 stars 31 forks source link

Remove panels from the block editor sidebar #123

Open bueltge opened 4 years ago

bueltge commented 4 years ago

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