WordPress: Custom Post Type Categories

[php]
$orderby = ‘name’;
$show_count = 1; // Show count? 1/0
$pad_counts = 0; // Pad counts? 1/0
$hierarchical = 1; // Hierarchical 1/0
$taxonomy = ‘directory_category’; // CPT Taxonomy Name
$title = ”; // Widget Title
$args = array(
‘orderby’ => $orderby,
‘show_count’ => $show_count,
‘pad_counts’ => $pad_counts,
‘hierarchical’ => $hierarchical,
‘taxonomy’ => $taxonomy,
‘title_li’ => $title
);
echo ‘

    ‘.”\n”;
    wp_list_categories($args);
    echo ‘

‘.”\n”;
[/php]

I was searching for a categories widget for custom post types in WordPress but couldn’t find one, so here is a quickly hashed together one. Enjoy.