Last active
February 18, 2024 15:17
-
-
Save taricco/4dcd3793a51ea695e0c645e14834ed54 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*** Create "Event Tag" for Event CPT | |
–––––––––––––––––––––––––––––––––––––––––––––––––– ***/ | |
function create_event_tags_taxonomy() { | |
register_taxonomy( | |
'event_tags', // Taxonomy key | |
'event', // Post type name | |
array( | |
'label' => __( 'Event Tags' ), | |
'rewrite' => array( 'slug' => 'event-tag' ), | |
'hierarchical' => false, // Set to false for tags, true for categories | |
'show_in_rest' => true, // Important for block editor/Gutenberg | |
) | |
); | |
} | |
add_action( 'init', 'create_event_tags_taxonomy', 0 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment