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

Merged
merged 5 commits into from Dec 28, 2017

Conversation

Projects
None yet
3 participants
@youknowriad
Contributor

youknowriad commented Dec 25, 2017

closes #3989

This PR hides the featured image panel on CPT not supporting it.

Testing instructions

  • Register a CPT not supporting the "thumbnail", "comments", "trackbacks", "excerpt", "revisions", "author" and "post-formats"
  • Create a new post for this CPT
  • The corresponding panel should not show up.

@youknowriad youknowriad added the Chrome label Dec 25, 2017

@youknowriad youknowriad self-assigned this Dec 25, 2017

@youknowriad youknowriad changed the title from Chrome: Hide the Featured Image Panel if the CPT doesn't support it to Chrome: Hide several Sidebar Panels if the CPT doesn't support it Dec 25, 2017

@jorgefilipecosta

I tested the changes and things look as expected. Nice work 👍

Show outdated Hide outdated editor/components/post-type-support-check/index.js Outdated

@youknowriad youknowriad merged commit c22bc9d into master Dec 28, 2017

2 of 3 checks passed

codecov/project 38.17% (-0.98%) compared to 67b12ea
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@youknowriad youknowriad deleted the update/featured-image-support branch Dec 28, 2017

function PostTypeSupportCheck( { postType, children, supportKey } ) {
const isSupported = get( postType, [ 'data', 'supports', supportKey ], false );
function PostTypeSupportCheck( { postType, children, supportKeys } ) {
const isSupported = some(

This comment has been minimized.

@aduth

aduth Jan 3, 2018

Member

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.

@aduth

aduth Jan 3, 2018

Member

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.

This comment has been minimized.

@youknowriad

youknowriad Jan 3, 2018

Contributor

I hesitated on adding an "operator". For now we only have the "or" use-case.

@youknowriad

youknowriad Jan 3, 2018

Contributor

I hesitated on adding an "operator". For now we only have the "or" use-case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment