Creates or modifies a taxonomy object.

Note: Do not use before the {@see ‘init’} hook.

A simple function for creating or modifying a taxonomy object based on the parameters given. If modifying an existing taxonomy object, note that the `$object_type` value from the original registration will be overwritten.

Signature

register_taxonomy( $taxonomy, $object_type, $args = array() )
taxonomy
 (string) Taxonomy key, must not exceed 32 characters.
object_type
 (array|string) Object type or array of object types with which the taxonomy should be associated.
args
 (array|string) Optional. Array or query string of arguments for registering a taxonomy.
Default: array()

Return

(WP_Error|void) WP_Error, if errors.

Source

function register_taxonomy( $taxonomy, $object_type, $args = array() ) {
	global $wp_taxonomies;

	if ( ! is_array( $wp_taxonomies ) )
		$wp_taxonomies = array();

	$args = wp_parse_args( $args );

	if ( empty( $taxonomy ) || strlen( $taxonomy ) > 32 ) {
		_doing_it_wrong( __FUNCTION__, __( 'Taxonomy names must be between 1 and 32 characters in length.' ), '4.2.0' );
		return new WP_Error( 'taxonomy_length_invalid', __( 'Taxonomy names must be between 1 and 32 characters in length.' ) );
	}

	$taxonomy_object = new WP_Taxonomy( $taxonomy, $object_type, $args );
	$taxonomy_object->add_rewrite_rules();

	$wp_taxonomies[ $taxonomy ] = $taxonomy_object;

	$taxonomy_object->add_hooks();

12 more lines...
WP Trac GitHub

Link here