register_acpt_post_type
Register a new custom post type
Register a new custom post type.
Usage
register_acpt_post_type([
'post_name' => 'cpt',
'singular_label' => 'New CPT',
'plural_label' => 'New CPTs',
'icon' => 'admin-appearance',
'supports' => [
'title',
'editor',
'comments',
'revisions',
'trackbacks',
'author',
'excerpt',
],
'labels' => [],
'settings' => [],
'permissions' => [],
]);Parameters
post_name
string
Required
The post type slug
singular_label
string
Required
The singular display label. Also accepted as singularLabel
plural_label
string
Required
The plural display label. Also accepted as pluralLabel
supports
array
Optional
WordPress post type features to enable — see official documentation. Defaults to ['title', 'editor']
labels
array
Optional
Override default generated labels — see official documentation. Auto-generated from singular_label/plural_label when omitted
settings
array
Optional
Additional post type arguments — see official documentation. Auto-generated with sensible defaults when omitted
permissions
array
Optional
Role-based capability overrides for this post type
Return
bool
true if the post type was registered successfully, false on failure
Last updated