Get current depth from dbquery_tree() result.
get_depth( array $index, int $child_id [, int $depth ] ) : array
$index (array) (Required) Results from dbquery_tree().
$child_id (int) (Required) Child ID.
$depth (int) (Optional) Default value: null
(array)
$index = dbquery_tree(DB_NEWS_CATS, 'news_cat_id', 'news_cat_parent');
$depth = get_depth($index, 1);
// 1