July 2017
Beginner to intermediate
386 pages
12h 55m
English
The register_taxonomy function is used to create a new type of category in WordPress and associate it to a post type. It has three parameters:
register_taxonomy( $taxonomy_name, $post_type, $options );
The first argument is a unique identifier for the taxonomy. The second parameter is the post type that it should be associated with, which should match the type declared with the register_post_type function. The third argument is an array of parameters that determine how the new taxonomy will behave.
In this example, we have set a few taxonomy options, including a first item called labels that contains an array of text strings that will be used in the interface when referring to the new taxonomy. We also specified a second ...
Read now
Unlock full access