Closed kaisermann closed 7 years ago
register_extended_taxonomy()
allows you to pass an array of post types:
register_extended_taxonomy( 'foo', [ 'post', 'page', 'my_cpt' ] );
Also, the $post_type->add_taxonomy()
method can be used to add an existing taxonomy to the post type (it first checks whether the taxonomy exists before trying to create it), so you can do something like this:
register_extended_taxonomy( 'foo', 'post' );
$hello_post_type = register_extended_post_type( 'hello' );
$hello_post_type->add_taxonomy( 'foo' );
Does that answer your question? As long as you register the post type(s) before the taxonomy you'll usually be able to do what you want to do.
Yeah it does! Thank you very much 😄
Is there a way to create a taxonomy with, let's say
register_extended_taxonomy
and use its return value as the parameter for$post_type->add_taxonomy()
?Thanks for the awesome lib!