-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Chrome: Hide several Sidebar Panels if the CPT doesn't support it #4161
Conversation
76b4c9e
to
cceab01
Compare
cceab01
to
6f27c2b
Compare
7ea49bc
to
097b3a0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested the changes and things look as expected. Nice work 👍
@@ -16,7 +16,9 @@ import { compose } from '@wordpress/element'; | |||
import { getCurrentPostType } from '../../store/selectors'; | |||
|
|||
function PostTypeSupportCheck( { postType, children, supportKey } ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the supportKey should be named supportKeys given that we accept more than one.
097b3a0
to
0fe2322
Compare
function PostTypeSupportCheck( { postType, children, supportKey } ) { | ||
const isSupported = get( postType, [ 'data', 'supports', supportKey ], false ); | ||
function PostTypeSupportCheck( { postType, children, supportKeys } ) { | ||
const isSupported = some( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be every
? I could imagine a need for both cases, i.e. a component that requires post type support for both X and Y, but alternatively X or Y.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hesitated on adding an "operator". For now we only have the "or" use-case.
closes #3989
This PR hides the featured image panel on CPT not supporting it.
Testing instructions