Custom Post Type Support

There are a couple of changes required to enable custom post types work with Oasis Workflow and Gutenberg editor.

Step 1:

Go to Workflows -> Settings, Workflow tab. Make sure the given post type is checked under “Show Workflow options for the following post/page types” setting.

Step 2:

Enable the custom post type for Gutenberg editor. 

Option 1: You can programmatically update a given custom post type to add support for Gutenberg and Oasis Workflow.

/**
 * Add REST API support to an already registered post type. Example - 'faq'
 */
add_filter( 'register_post_type_args', 'update_custom_post_type_args', 10, 2 );

function update_custom_post_type_args( $args, $post_type ) {

	if ( 'faq' === $post_type ) {
		$args['show_in_rest'] = true;
		array_push( $args['supports'], 'custom-fields' );
		array_push( $args['supports'], 'revisions' );
	}

	return $args;
}

Option 2: Use Custom Post Types UI Plugin.

If you are using CPT plugin like “Custom Post Type UI” then, make sure the following is setup correctly for the given custom post type.

  • “Show in REST API” setting – this setting should be set to “true” for the CPT to work with Gutenberg editor.
  • Under the “Supports” section, make sure “Custom Fields” and “Revisions” is checked.

Once you do the above the CPT should work fine with Gutenberg Editor and Oasis Workflow plugin.