Codex

Function Reference/register taxonomy for object type

Contents

Description

This function adds an already registered taxonomy to an (custom) object type. It takes in a name, an object name that it affects. It returns true on success.

Usage

 <?php register_taxonomy_for_object_type($taxonomy$object_type); ?> 

Parameters

$taxonomy
(string) (required) The name of the taxonomy.
Default: None
$object_type
(string) (required) A name of the object type for the taxonomy object.
Default: None

Example

<?php register_taxonomy_for_object_type('category''foo'); ?> 

Change Log

Since: 3.0

Source File

register_taxonomy_for_object_type() is located in wp-includes/taxonomy.php.

Related

Terms: is_term(), term_exists(), get_term(), get_term_by(), get_term_children(), get_terms(), sanitize term(), wp_get_object_terms()

See also index of Function Reference and index of Template Tags.