_get_term_hierarchy [ WordPress Function ]
_get_term_hierarchy ( $taxonomy )
| Access: |
|
| Parameters: |
|
| Uses: | |
| Returns: |
|
| Defined at: |
|
Soorgelijke functies: get_page_hierarchy, get_term_by, get_term_field, get_temp_dir, _get_term_children
Retrieves children of taxonomy as Term IDs.
Source
<?php
function _get_term_hierarchy($taxonomy) {
if ( !is_taxonomy_hierarchical($taxonomy) )
return array();
$children = get_option("{$taxonomy}_children");
if ( is_array($children) )
return $children;
$children = array();
$terms = get_terms($taxonomy, array('get' => 'all', 'orderby' => 'id', 'fields' => 'id=>parent'));
foreach ( $terms as $term_id => $parent ) {
if ( $parent > 0 )
$children[$parent][] = $term_id;
}
update_option("{$taxonomy}_children", $children);
return $children;
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- #14704 (_get_term_hierarchy() should check for populated array ...
http://core.trac.wordpress.org/browser/trunk/wp-includes/taxonomy.php#L2311. By default, the 'category_children' option is populated with a serialized empty ...
core.trac.wordpress.org - _get_term_hierarchy
Function and Method Cross Reference. _get_term_hierarchy(). Defined at: /wp- includes/taxonomy.php -> line 2717. Referenced 10 times: ...
phpxref.ftwr.co.uk - _get_term_hierarchy (WordPress Function) - WPSeek.com
WordPress lookup for _get_term_hierarchy, a WordPress Function. wpseek.com is a WordPress-centric search tool for developers and theme authors.
wpseek.com - _get_term_hierarchy() WordPress function reference, arguments ...
_get_term_hierarchy(). Retrieves children of taxonomy as Term IDs. Signature. _get_term_hierarchy( $taxonomy ). taxonomy: (string) Taxonomy Name. Return ...
queryposts.com