register_acpt_taxonomy
Register a new custom taxonomy
Register a new custom taxonomy.
Usage
register_acpt_taxonomy([
'slug' => 'new-tax',
'singular_label' => 'New Taxonomy',
'plural_label' => 'New Taxonomies',
'labels' => [],
'settings' => [],
'post_types' => ['new-cpt'],
]);Parameters
Parameter
Type
Required
Description
slug
string
Required
The taxonomy 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
post_types
array
Optional
Post type slugs to associate this taxonomy with. Also accepted as postTypes. Defaults to none
labels
array
Optional
Override default generated labels — see official documentation. Auto-generated when omitted
settings
array
Optional
Additional taxonomy arguments — see official documentation. Auto-generated with sensible defaults when omitted
permissions
array
Optional
Role-based capability overrides for this taxonomy
Return
Type
Description
bool
true on success, false on failure
Last updated