get_categories array question – display parent and child in order

I am still learning the dev side of wordpress and am running into what I hope is a noob error.

I’m trying to display the categories in a drop down (the status plugin on WPMUDev) with all categories displayed with the child categories under each parent category.


– Parent 1

— Child 1 of parent 1

— Child 2 of parent 1

– Parent 2

— Child 1 of parent 2

— Child 2 of parent 2

Here’s the line I’m playing with. Right now, it’s simply displaying all categoried in DESC order by name (which is what I think I’m telling it to do). I cannot find a guide as to what ‘orderby’ options there are, or any good explanations of these array types.

$categories = get_categories(array(‘type’=>’post’, ‘taxonomy’=>’category’, ‘hierarchical’=>1, ‘order’=>’DESC’,’orderby’=>’name’, ‘hide_empty’=>0,’exclude’=> array( 21, 22, 23 ),));

I am assuming there must be a ‘orderby’=>’taxonomy’ (note – orderby ID does not solve the issue. Also, I can get it to display parent only, or child only by adding additional arrays but want to have it all there).

Thanks in advance —