I would like to edit the text or remove and re-create the Publish panel of Gutenberg's PrePublish Panel in the editor sidebar.
I know I can use wp.data.dispatch( 'core/edit-post' ).removeEditorPanel( 'example-panel' );
but it doesn't seem to work for any panels in editor-post-publish-panel
. Any ideas?
The background is that I used the slotfill API to insert a timezone select field so authors can use their local times when selecting their publish date time. That all works great, except when they click Schedule and get the publish time in GMT without any context.
.remove()
or.hide()
for the time being. But, can you show the code for "I used the slotfill API to insert a timezone select field"?wp.data.select('core/edit-post').isPublishSidebarOpened()
and then use a pseudo css class to select the 2nd div in jQuery. Very hacky though and will cause React to redraw everything....editor-post-publish-panel__prepublish :nth-child(4){ visibility:hidden; }
... but it is definitely hack-y haha