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

Add Filter to make it possible to only add gutenberg links on a per post type basis #2528

Conversation

aaronjorbin
Copy link
Member

Right now, Gutenberg is not the right experience for all post types. In order to help encourage testing, we should make it possible to remove the quick action from certain post types.

This is needed in order to add gutenberg to the WordCamp family of sites.

cc/ @coreymckrill

See: https://meta.trac.wordpress.org/ticket/3065#comment:5

…ost type basis

Right now, Gutenberg is not the right experience for all post types. In order to help encourage testing, we should make it possible to remove the quick action from certain post types.

See: https://meta.trac.wordpress.org/ticket/3065#comment:5
@BE-Webdesign
Copy link
Contributor

I think taking the post_type supports is a better approach for this. Then the link can be determined by whether the current post_type supports the block editor or not rather than a filter on the hook.


if ( $can_edit_post && 'trash' !== $post->post_status ) {
if ( $can_edit_post && 'trash' !== $post->post_status && apply_filters( 'gutenberg_add_edit_link_for_post_type', true, $post_type, $post ) ) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we want post types other than post and page enabled by default.

@aaronjorbin
Copy link
Member Author

I think it should be opt out for now. Plugins such as Gutenberg shouldn't require people to change calls to register_post_type.

@mtias mtias merged commit 6884717 into WordPress:master Aug 28, 2017
@BE-Webdesign
Copy link
Contributor

I think it should be opt out for now. Plugins such as Gutenberg shouldn't require people to change calls to register_post_type.

We don't need to do that. In the REST API, the approach was to hook into the global post types and add the necessary attributes to posts and pages. A lot of people are confused about why Gutenberg can be loaded on every CPT by default, which has created some anxiety around it. People feel it is being thrown onto them. This approach does not follow how core does things as well. Many people do not register support for the editor for CPTs, likewise Gutenberg should respect that. Not that this won't happen in the future, but this leads to more confusion a lot of people already hold for Gutenberg at the moment.

Do all CPTs on WordCamp use post_content and the editor?

@coreymckrill
Copy link
Contributor

Do all CPTs on WordCamp use post_content and the editor?

I think almost all of them register support for the editor, but there are a couple that don't actually use post_content for anything. The biggest problem is that most of the CPTs make use of extensive postmeta, via meta boxes. So if a user lands on the Gutenberg edit screen for one of those, they won't be able to edit most of the pertinent information and it could be really confusing/frustrating for them.

@BE-Webdesign
Copy link
Contributor

BE-Webdesign commented Aug 28, 2017

@coreymckrill

The biggest problem is that most of the CPTs make use of extensive postmeta, via meta boxes. So if a user lands on the Gutenberg edit screen for one of those, they won't be able to edit most of the pertinent information and it could be really confusing/frustrating for them.

Try #2583 if you can, and see if it somewhat works, I would be interested to know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants