Make WordPress Core


Ignore:
Timestamp:
01/11/2010 07:27:44 PM (16 years ago)
Author:
ryan
Message:

Show custom hierarchical taxonomies in the menus. Props dd32. see #11838

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/category-template.php

    r12598 r12694  
    338338        'selected' => 0, 'hierarchical' => 0,
    339339        'name' => 'cat', 'class' => 'postform',
    340         'depth' => 0, 'tab_index' => 0
     340        'depth' => 0, 'tab_index' => 0,
     341        'taxonomy' => 'category', 'hide_if_empty' => false
    341342    );
    342343
     
    360361    $class = esc_attr($class);
    361362
    362     $output = '';
     363    if ( ! $r['hide_if_empty'] || ! empty($categories) )
     364        $output = "<select name='$name' id='$name' class='$class' $tab_index_attribute>\n";
     365    else
     366        $output = '';
    363367    if ( ! empty( $categories ) ) {
    364         $output = "<select name='$name' id='$name' class='$class' $tab_index_attribute>\n";
    365368
    366369        if ( $show_option_all ) {
     
    382385
    383386        $output .= walk_category_dropdown_tree( $categories, $depth, $r );
     387    }
     388    if ( ! $r['hide_if_empty'] || ! empty($categories) )
    384389        $output .= "</select>\n";
    385     }
     390
    386391
    387392    $output = apply_filters( 'wp_dropdown_cats', $output );
Note: See TracChangeset for help on using the changeset viewer.