Skip to content

PluginSidebar / Plugins do not work in Widget Editor #65714

@hrkhal

Description

@hrkhal

Description

Plugins , and therefore PluginSidebars, do not render in the Widget Block Editor.

They can be seen in wp.plugins.getPlugins, but they are not rendered in the menu or as any pinned items. The same plugins rendered as expected in a Post Block Editor.

Step-by-step reproduction instructions

This can be reproduced with this simple plugin based on Gutenberg documentation. The below plugin will register but nothing is output.

import { PluginSidebar } from '@wordpress/edit-post';
import { registerPlugin } from '@wordpress/plugins';
import { useState } from '@wordpress/element';

const PluginSidebarExample = () => {
	return (
		<PluginSidebar
			name="plugin-sidebar-example"
			title={'My PluginSidebar'}
			icon={ 'smiley' }
		>hello</PluginSidebar>
	);
};

// Register the plugin
registerPlugin( 'plugin-sidebar-example', { render: PluginSidebarExample } );

editPost exists in the wp object in the Widget Block Editor context. For what it's worth there isn't a PluginSidebar on the editWidgets object like there is for editSite

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Type] BugAn existing feature does not function as intended

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions