Skip to content

PluginSidebar / Plugins do not work in Widget Editor #65714

Closed

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

Activity

  1. added
    [Type] BugAn existing feature does not function as intended
    on Sep 28, 2024
  2. changed the title [-]PluginSidebar / Plugins do work in Widget Editor[/-] [+]PluginSidebar / Plugins do not work in Widget Editor[/+] on Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Type] BugAn existing feature does not function as intended

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions