Ticket #20810: wp_dropdown_categories_disabled_opt.patch
File wp_dropdown_categories_disabled_opt.patch, 1.1 KB (added by , 12 years ago) |
---|
-
category-template.php
307 307 'name' => 'cat', 'id' => '', 308 308 'class' => 'postform', 'depth' => 0, 309 309 'tab_index' => 0, 'taxonomy' => 'category', 310 'hide_if_empty' => false 310 'hide_if_empty' => false, 311 'disabled' => '', 311 312 ); 312 313 313 314 $defaults['selected'] = ( is_category() ) ? get_query_var( 'cat' ) : 0; … … 329 330 $tab_index_attribute = ''; 330 331 if ( (int) $tab_index > 0 ) 331 332 $tab_index_attribute = " tabindex=\"$tab_index\""; 332 333 334 $disabled_attribute = ''; 335 if( $disabled ) 336 $disabled_attribute = ' disabled="disabled"'; 333 337 $categories = get_terms( $taxonomy, $r ); 334 338 $name = esc_attr( $name ); 335 339 $class = esc_attr( $class ); 336 340 $id = $id ? esc_attr( $id ) : $name; 337 341 338 342 if ( ! $r['hide_if_empty'] || ! empty($categories) ) 339 $output = "<select name='$name' id='$id' class='$class' $tab_index_attribute >\n";343 $output = "<select name='$name' id='$id' class='$class' $tab_index_attribute$disabled_attribute>\n"; 340 344 else 341 345 $output = ''; 342 346