Contents
How to enable Gutenberg editor for custom post types?
Usually, you don’t have to do anything more to enable Gutenberg if using CPT UI. But if you still find that your CPT uses the classic editor, check the following. Go to the Registered Types/Taxonomies page under CPT UI. Then click the CPT for which you want to enable Gutenberg.
Is the Gutenberg editor available in WordPress 5.0?
Since WordPress custom post types are almost everywhere, the unavailability of Gutenberg editor is something that the community has been talking about since the release of WordPress 5.0. This means that if you have CPT on your WordPress 5.x website, you will see the dear old Classic Editor when you create or edit a CPT.
How to create custom post types in WordPress?
Start by registering a Gutenberg WordPress custom type. The process is fairly easy and involves adding the following the code snippet. Once the snippet in place, the custom post type has been registered. However, in a surprising twist, when you try to create or edit a custom post type, you will still see the old Classic editor.
Which is the default editor for WordPress classic?
As you can see, the default editor is the Classic Editor instead of the Gutenberg. The previous section added a Project CPT to WordPress and the CPT uses the Classic Editor instead of the Gutenberg. It’s easy to add support for the Gutenberg in CPT but adding the show_in_rest key with true value.
Can you pass post type name in Gutenberg?
Of course you can not use it anywhere you want, it must be wrapped into withSelect higher order component (HOC), you can jump to the example if you want. Yes, it is possible to pass the post type name if you want to get the posts of a certain type only, not possible to pass multiple values.
When to avoid registering blocks in Gutenberg editor?
Registering plenty of blocks in the Gutenberg editor can bog down the user experience. Then, it is a good practice to avoid registering blocks whenever they are not needed, such as when creating a custom block that needs be accessed for a specific custom post type only.