Skip to content

Overview of Custom Post Types Model

Pedro de Carvalho edited this page Jul 29, 2026 · 2 revisions

The model for a Custom Post Type will define how it will behave and what features it will have.

Example:

return [
	'type'         => 'cpt',
	'active'       => true,
	'name'         => 'book',
	'block_editor' => false,
	'features'     => [],
	'supports'     => [],
	'labels'       => [],
	'options'      => [],
	'meta'         => [],
	'settings'     => [],
];

Available parameters and description:

Parameter Description
active boolean - sets this model to active or inactive
type string - type of model
name string - identifier of the custom post type
block_editor boolean - if the Block Editor should be enabled or not (true to enable Gutenberg, false to use the Classic Editor)
features array - Features that this CPT will support — see Features Overview
supports array - refer to the supports argument of the register_post_type function from WordPress
labels array - Everything related with labels for this CPT — see Labels. Supports has_one, has_many, text_domain, featured_image, and overrides for granular control
options array - Refer to the second argument ($args) in the register_post_type function from WordPress. Also supports show_in_rest, mcp_tools for feature gating
meta array - Information for the Metaboxes for this CPT — see Meta
settings array - Information for the Settings page of this CPT — see Settings
config array - Per-feature gating configuration for REST and MCP access — see Feature Gating

Clone this wiki locally