WordPress / wporg-gutenberg

The theme for https://wordpress.org/gutenberg/
https://wordpress.org/gutenberg/
10 stars 5 forks source link

If possible, untoggle the inspector by default. #52

Open StevenDufresne opened 1 year ago

StevenDufresne commented 1 year ago

The sidebar should be close on page load.

StevenDufresne commented 1 year ago

Just circling back, because of how plugins.registerPlugin is called, a caller later can override any changes we make in our plugin. I'm not certain how to persist our plugin changes without being part of Gutenberg core logic.

jasmussen commented 1 year ago

I could be misremembering, but @youknowriad do you recall if there is a prop to start the block editor with the inspector closed?

youknowriad commented 1 year ago

I'm not sure what "prop" is that. But I think you should be able to do so by calling:

wp.data.dispatch( wp.editPost.store ).closeGeneralSidebar();

there might be some timing considerations though as mentioned above. (have to run after the editor loads or something)