get_category_children [ WordPress Function ]
get_category_children ( $id, $before = '/', $after = '', $visited = array() )
| Parameters: |
|
| See: | |
| Returns: |
|
| Defined at: |
|
Benzer Fonksiyonlar: get_term_children, _get_term_children, get_page_children, get_category_link, get_category_parents
Retrieve category children list separated before and after the term IDs.
Source
<?php
function get_category_children( $id, $before = '/', $after = '', $visited = array() ) {
_deprecated_function( __FUNCTION__, '2.8', 'get_term_children()' );
if ( 0 == $id )
return '';
$chain = '';
/** TODO: consult hierarchy */
$cat_ids = get_all_category_ids();
foreach ( (array) $cat_ids as $cat_id ) {
if ( $cat_id == $id )
continue;
$category = get_category( $cat_id );
if ( is_wp_error( $category ) )
return $category;
if ( $category->parent == $id && !in_array( $category->term_id, $visited ) ) {
$visited[] = $category->term_id;
$chain .= $before.$category->term_id.$after;
$chain .= get_category_children( $category->term_id, $before, $after );
}
}
return $chain;
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- WordPress › Support » function get_category_children has a line i ...
Hi guys, i am modifying my template and i read this function of wordpress but there is a line that if erased nothing changes so i guess it does nothing.The line is ...
wordpress.org - #9007 (Poor get_category_children() performance; rewrite to use ...
Running get_categories() with the 'child_of' parameter calls get_category_children(). This call hits the 30-second server time limit. Outside the web environment, ...
core.trac.wordpress.org - get_category_children() WordPress function reference, arguments ...
Retrieve category children list separated before and after the term IDs.
queryposts.com - get_category_children (WordPress Function) - WPSeek.com
WordPress lookup for get_category_children, a WordPress Function. wpseek. com is a WordPress-centric search tool for developers and theme authors.
wpseek.com