函数通过get_categories()函数显示wordpress中没有子类别的类别

I made this function to show the top navigation for my theme:

function costume_menu() {

$categories =  get_categories('hide_empty=0&style=none'); 
  foreach ($categories as $category) {
    $nav = '<li>';
    $nav .= '<a href="'.get_category_link($category->term_id).'">'.strtoupper($category->cat_name).'</a>';
    $nav .= '</li>';

    echo $nav;
  }

} 

but it shows all the categories and subcategories together, I tried to read in the codex site of wordpress to exclude only subcategories but I couldnt find anything!

This should work

$categories =  get_categories('hide_empty=0&style=none&parent=0');