Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




register_taxonomy_for_object_type [ WordPress Function ]

register_taxonomy_for_object_type ( $taxonomy, $object_type )
Parameters:
  • (string) $taxonomy Name of taxonomy object
  • (string) $object_type Name of the object type
Uses:
  • $wp_taxonomies
Returns:
  • (bool) True if successful, false if not
Defined at:



Add an already registered taxonomy to an object type.

Source


<?php
function register_taxonomy_for_object_type$taxonomy$object_type) {
    global 
$wp_taxonomies;

    if ( !isset(
$wp_taxonomies[$taxonomy]) )
        return 
false;

    if ( ! 
get_post_type_object($object_type) )
        return 
false;

    if ( ! 
in_array$object_type$wp_taxonomies[$taxonomy]->object_type ) )
        
$wp_taxonomies[$taxonomy]->object_type[] = $object_type;

    return 
true;
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics