I'm trying to reuse a function, but it's not getting the arguments values:
function has_children($arg1, $arg2){
echo $arg1.'<br>'.$arg2;
$children = get_term_children( $arg1, 'area' );
if(empty($children)){
$term_children_slug = $arg2;
}
}
One of the places where it is used
if (is_tax('area')){
$term_slug = $queried_object->slug;
$term_id = $queried_object->term_id;
has_children($term_id, $term_slug);
}
The values are printed but not used inside the function.
echo $childrenis there anything displayed?echo $arg1.'<br>'.$arg2;?$term_children_slug? It looks like a global, but you don't declare it as such in your function...