WordPress.org

Make WordPress Core

Ticket #20156: post-template.multiselect_dropdown_categories.patch

File post-template.multiselect_dropdown_categories.patch, 851 bytes (added by jackreichert, 6 years ago)

Same fix for wp_dropdown_categories

  • category-template.php

     
    307307                'name' => 'cat', 'id' => '',
    308308                'class' => 'postform', 'depth' => 0,
    309309                'tab_index' => 0, 'taxonomy' => 'category',
    310                 'hide_if_empty' => false
     310                'hide_if_empty' => false,
     311                'multiselect' => false
    311312        );
    312313
    313314        $defaults['selected'] = ( is_category() ) ? get_query_var( 'cat' ) : 0;
     
    336337        $id = $id ? esc_attr( $id ) : $name;
    337338
    338339        if ( ! $r['hide_if_empty'] || ! empty($categories) )
    339                 $output = "<select name='$name' id='$id' class='$class' $tab_index_attribute>\n";
     340                $output = "<select name='$name' id='$id'".(($multiselect) ? "multiple='multiple'" : "")." class='$class' $tab_index_attribute>\n";
    340341        else
    341342                $output = '';
    342343