Skip to content
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

Don't show the classic editor dropdown on unsupported post types. #3146

Merged

Conversation

pento
Copy link
Member

@pento pento commented Oct 25, 2017

The editor selector dropdown on the post list table shows on post types that aren't supported, which isn't ideal.

This PR addresses that, as well as tidies up some of the post and post type checks that are used to decide whether Gutenberg can edit the post or post type.

@pento pento added Gutenberg Plugin Issues or PRs related to Gutenberg Plugin management related efforts [Type] Bug An existing feature does not function as intended labels Oct 25, 2017
@pento pento self-assigned this Oct 25, 2017
$post_type = $post->post_type;
$post_type_object = get_post_type_object( $post_type );

if ( 'attachment' === $post_type ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noting that we're no longer checking this in gutenberg_can_edit_post_type, and while I don't know the original reason why we were explicitly targeting attachment, my understanding is this should still be effective since post_type_supports( 'attachment', 'editor' ) === false.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yah, that's why I dropped it, it was an unnecessary extra check. :-)

@pento pento merged commit c588bdd into master Oct 26, 2017
@pento pento deleted the fix/classic-editor-dropdown-showing-on-unsupported-post-types branch October 26, 2017 00:38
pento added a commit that referenced this pull request Oct 26, 2017
pento added a commit that referenced this pull request Oct 26, 2017
)

Also adds a new `gutenberg_can_edit_post_type` filter, so plugins can disable Gutenberg by post type.
pento added a commit that referenced this pull request Oct 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Gutenberg Plugin Issues or PRs related to Gutenberg Plugin management related efforts [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants