Remove Visibility options
Is there any way to remove the visibility options from the Status & Visibility section?
Hey @woorise
I see your issue has been overlooked.
Let's see if someone can give a comment here. @WordPress/gutenberg-core
Hey @woorise - currently there is not an option to do that and honestly I don't know if it's a good idea implement this in core.
I think an easy alternative would be to use just some css to hide it, no?
Hey @ntsekouras, that's how we do it right now but it would be nice to have a better control over the options to prevent more experienced users to alter them.
We are running a multisite installation and we would like to conditionally show/hide some options such as the "Stick to the top of the blog" or the "Pending review".
It was implemented with https://github.com/WordPress/gutenberg/pull/17117:
You can remove this panel with the following JS call:
wp.data.dispatch( 'core/edit-post' ).removeEditorPanel( 'post-status' );
Do we have docs for the JS call?
@mkaz
Actually, it's an individual visibility option from the panel.
Is there any way to remove the visibility options from the Status & Visibility section?
It can be disabled by removing the permission for the user:
https://github.com/WordPress/gutenberg/blob/004a32ec09d5b789be694d85725fe49cca385f08/packages/editor/src/components/post-visibility/check.js#L12-L15
However, it's too general I don't think that useful in this context.
The dropdown proposed in https://github.com/WordPress/gutenberg/pull/42030#issuecomment-1171646574 would address this.
https://user-images.githubusercontent.com/4933/176771391-8a450f38-068b-451d-af19-9430a7f51a20.mov
The 'Status & Visibility' panel this refers to doesn't exist anymore after the publish flow redesign in WP 6.6, and the visibility options are now part of the status control. Hiding individual controls of that section granularly is still not possible, but #75529 tracks that request against the current UI, so let's continue there and close this one.