gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

Remove Visibility options

Open woorise opened this issue 7 years ago • 8 comments

Is there any way to remove the visibility options from the Status & Visibility section?

woorise avatar Sep 11 '19 17:09 woorise

Hey @woorise

I see your issue has been overlooked.

Let's see if someone can give a comment here. @WordPress/gutenberg-core

paaljoachim avatar Jan 18 '21 17:01 paaljoachim

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?

ntsekouras avatar Jan 22 '21 11:01 ntsekouras

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".

woorise avatar Jan 22 '21 11:01 woorise

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' );

gziolo avatar Jan 22 '21 13:01 gziolo

Do we have docs for the JS call?

@mkaz

paaljoachim avatar Jan 22 '21 13:01 paaljoachim

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.

gziolo avatar Jan 22 '21 13:01 gziolo

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

noisysocks avatar Jul 15 '22 03:07 noisysocks

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.

ntsekouras avatar Aug 28 '26 06:08 ntsekouras