Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

registerPlugin is not working in Site editor #38547

Open
wpsoul opened this issue Feb 5, 2022 · 4 comments
Open

registerPlugin is not working in Site editor #38547

wpsoul opened this issue Feb 5, 2022 · 4 comments
Labels
[Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") [Package] Plugins /packages/plugins [Type] Bug An existing feature does not function as intended

Comments

@wpsoul
Copy link

wpsoul commented Feb 5, 2022

Description

When using function to register custom plugin for Sidebar, it doesn't work inside Site Editor environment (but works for post edit)

https://developer.wordpress.org/block-editor/how-to-guides/plugin-sidebar-0/

Also, when using Site editor, there is no back button, so, it's impossible to leave Editor and return to dashboard.

Step-by-step reproduction instructions

  1. Register sidebar with registerPlugin or use any plugin which supports this options (I tried Greenshift, Qubely, Stackable)
  2. Edit post - editor has custom plugin
  3. Go to Appearance - Editor. No custom plugins are available in sidebar

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

@amustaque97 amustaque97 added the Needs Testing Needs further testing to be confirmed. label Feb 5, 2022
@leeshadle
Copy link

I'm seeing the same thing, a registered plugin sidebar works everywhere but the 'Site Editor'.

@awps
Copy link
Contributor

awps commented Mar 7, 2022

No matter what I do, followed all the docs for registerPlugin, and it works everywhere except the Site Editor.

@skorasaurus skorasaurus added [Package] Plugins /packages/plugins [Type] Bug An existing feature does not function as intended [Feature] Full Site Editing and removed Needs Testing Needs further testing to be confirmed. labels Mar 10, 2022
@vladolaru
Copy link

Ping!

@t-hamano
Copy link
Contributor

t-hamano commented Aug 7, 2022

For example, if you want to use PluginSidebar in the site editor, you need to load from another package, as shown below:

( function ( wp ) {
	...
    var PluginSidebar = wp.editSite.PluginSidebar;
	...
} )( window.wp );

In addition, change the dependencies for enqueuing javascript as follows:

wp_register_script(
    'plugin-sidebar-js',
    plugins_url( 'plugin-sidebar.js', __FILE__ ),
    array( 'wp-plugins', 'wp-edit-site', 'wp-element' ) // change dependencies
);

However, this is not mentioned in the documentation and may be confusing to developers, so it might be worth considering to update the documentation.

@annezazu annezazu added [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") and removed [Feature] Full Site Editing labels Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") [Package] Plugins /packages/plugins [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

8 participants