JavaScript for WordPress Forums Gutenberg Development Gutenberg on CPTs and ACF compatibility

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • #39896


    I was initially asking how to add Gutenberg to a Custom Post Type but after some digging in the code I found it.
    Your CPT declaration must have show_in_rest => true and supports ‘editor’.

    You can add ?classic-editor at the end of the admin URL to switch to the standard editor, for example in order to access the Yoast Metaboxes.

    For ACF, it’s already compatible. And pretty well integrated. Wonderful!
    ACF compatible

    I’ve also found a filter to allow Post Types to have Gutenberg:
    add_filter('gutenberg_can_edit_post_type', true, 'my_post_type_slug');

    So for now I’m going to try to replace my ACF + Flexible “builder” with a full Gutenberg approach. Which me luck 🙂

    Thanks Zac for the great course!

    Zac Gordon

    Great sharing!!! Wishing you luck!!!


    Thanks for sharing what you found. I’m not sure, though, that the syntax for add_filter is correct. When I’ve used add_filter, the second param was a call back function.


    This helped me:

    View this gist on GitHub


    For anyone who is using gutenberg_can_edit_post_type filter, the equivalent filters in WordPress 5.0 are use_block_editor_for_post and use_block_editor_for_post_type.

    Block Editor Filters

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.