wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren
_get_term_children [ WordPress Function ]
| Zugriff: |
|
| Parameter: |
|
| Gibt zurück: |
|
| Definiert in: |
|
Get the subset of $terms that are descendants of $term_id.
If $terms is an array of objects, then _get_term_children returns an array of objects. If $terms is an array of IDs, then _get_term_children returns an array of IDs.
Source
<?php
function &_get_term_children($term_id, $terms, $taxonomy) {
$empty_array = array();
if ( empty($terms) )
return $empty_array;
$term_list = array();
$has_children = _get_term_hierarchy($taxonomy);
if ( ( 0 != $term_id ) && ! isset($has_children[$term_id]) )
return $empty_array;
foreach ( (array) $terms as $term ) {
$use_id = false;
if ( !is_object($term) ) {
$term = get_term($term, $taxonomy);
if ( is_wp_error( $term ) )
return $term;
$use_id = true;
}
if ( $term->term_id == $term_id )
continue;
if ( $term->parent == $term_id ) {
if ( $use_id )
$term_list[] = $term->term_id;
else
$term_list[] = $term;
if ( !isset($has_children[$term->term_id]) )
continue;
if ( $children = _get_term_children($term->term_id, $terms, $taxonomy) )
$term_list = array_merge($term_list, $children);
}
}
return $term_list;
}
?>
Beispiele [ wp-snippets.com ]
Top Google Suchergebnisse
- Function Reference/get term children « WordPress Codex
Description. Merge all term children into a single array. This recursive function will merge all of the children of $term into the same array. Only useful for ...
codex.wordpress.org - #8087 (get_terms problems) – WordPress Trac
Because $child_of == 0 and such terms have a non-zero parent, _get_term_children excludes them. get_terms allows you to select fields "ids" or " names," in ...
core.trac.wordpress.org - Ontology Lookup Service (OLS)
extensibility, <wsdlsoap:operation soapAction="getTermChildren"/>. input, < wsdlsoap:body use="literal"/>. output, <wsdlsoap:body use="literal"/> ...
www.ebi.ac.uk - terms - How to get_term_children output in alphabetical order ...
May 13, 2011 ... How do i get output of this in alphabetical order <?php $termID = 5; $ taxonomyName = 'area'; $termchildren = get_term_children( $termID, ...
wordpress.stackexchange.com