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

Documentation: Add examples of how to programmatically remove the panels in Document sidebar #17281

Closed
gziolo opened this issue Aug 30, 2019 · 2 comments · Fixed by #48895
Closed
Assignees
Labels
[Feature] Extensibility The ability to extend blocks or the editing experience [Status] In Progress Tracking issues with work in progress [Type] Developer Documentation Documentation for developers

Comments

@gziolo
Copy link
Member

gziolo commented Aug 30, 2019

Follow-up for:

#11802

Execute the following code in the JS console to remove one of the panels and ensure it is not present in the sidebar and Options modal (you can access it from More Menu):

wp.data.dispatch( 'core/edit-post').removeEditorPanel( 'taxonomy-panel-category' ) ;
wp.data.dispatch( 'core/edit-post').removeEditorPanel( 'taxonomy-panel-post_tag' );
wp.data.dispatch( 'core/edit-post').removeEditorPanel( 'featured-image' );
wp.data.dispatch( 'core/edit-post').removeEditorPanel( 'post-excerpt' );
wp.data.dispatch( 'core/edit-post').removeEditorPanel( 'discussion-panel' );

Note that you can't remove Post & Visibility panel. The following (despite being valid) won't be reflected in the UI:

wp.data.dispatch( 'core/edit-post').removeEditorPanel( 'post-status' );

Aside: It will be possible to remove post-status panel if PR #17117 from @noahtallen is going to be accepted (which is very likely).

@gziolo gziolo added [Type] Developer Documentation Documentation for developers [Feature] Extensibility The ability to extend blocks or the editing experience labels Aug 30, 2019
@gziolo
Copy link
Member Author

gziolo commented Apr 28, 2020

@mkaz or @ryanwelcher – any thoughts were to add related documentation? Would it make sense to add a tutorial on how to manage Document settings sidebar with the existing SlotFills (like https://github.com/WordPress/gutenberg/blob/master/packages/edit-post/src/components/sidebar/plugin-document-setting-panel/index.js) and removeEditorPanel action?

@ryanwelcher
Copy link
Contributor

ryanwelcher commented Apr 28, 2020

I like the idea of adding some SlotFill tutorials to the handbook. This would also address #19747

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Extensibility The ability to extend blocks or the editing experience [Status] In Progress Tracking issues with work in progress [Type] Developer Documentation Documentation for developers
Projects
None yet
2 participants