function get_category_children has a line i can’t find its purpose;
-
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 emphasized below.
function get_category_children($id, $before = '/', $after = '') {
if ( 0 == $id )
return '';
$cat_ids = get_all_category_ids();
foreach ( $cat_ids as $cat_id ) {
if ( $cat_id == $id)
continue;
$category = get_category($cat_id);
if ( $category->category_parent == $id ) {
$chain .= $before.$category->cat_ID.$after;
$chain .= get_category_children($category->cat_ID, $before, $after);
}
}
return $chain;
}This is the issued line:
$chain .= get_category_children($category->cat_ID, $before, $after);What’s it purpose in the above code and why if erased the function still returns the children of the category transmitted as parameter?
Thanks.
- The topic ‘function get_category_children has a line i can’t find its purpose;’ is closed to new replies.