post_type) && !empty($screen->post_type)) $post_type = $screen->post_type; else { switch($screen->parent_file) { case "upload.php" : $post_type = 'attachment'; break; default: $post_type = 'post'; } } } $post_type_data = get_post_type_object($post_type); if (!taxonomy_exists($taxonomy)) $taxonomy = ''; ?>

'; //output all available taxonomies for this post type $post_type_taxonomies = get_object_taxonomies($post_type); foreach ($post_type_taxonomies as $key => $taxonomy_name) { $taxonomy_info = get_taxonomy($taxonomy_name); if ($taxonomy_info->hierarchical !== TRUE) unset($post_type_taxonomies[$key]); } //use the first taxonomy if emtpy taxonomy if ($taxonomy == '' || !taxonomy_exists($taxonomy)) { reset($post_type_taxonomies); $taxonomy = current($post_type_taxonomies); } if (count($post_type_taxonomies) > 1) { ?>

labels->name) ?>

0, 'taxonomy' => $post_type_taxonomy ); $taxonomy_terms = get_terms( $args ); ?>
 
name="taxonomy">  label ?> (labels->singular_name; ?>)

    listTerms($taxonomy); ?>

'term_order', 'depth' => 0, 'child_of' => 0, 'hide_empty' => 0 ); $taxonomy_terms = get_terms($taxonomy, $args); $output = ''; if (count($taxonomy_terms) > 0) { $output = $this->TOwalkTree($taxonomy_terms, $args['depth'], $args); } echo $output; } function TOwalkTree($taxonomy_terms, $depth, $r) { $walker = new TO_Terms_Walker; $args = array($taxonomy_terms, $depth, $r); return call_user_func_array(array(&$walker, 'walk'), $args); } } ?>