Ticket #19851: category-template.diff
File category-template.diff, 1.5 KB (added by , 13 years ago) |
---|
-
wp-includes/category-template.php
284 284 * 'name' (string) - The name attribute value for select element. 285 285 * 'id' (string) - The ID attribute value for select element. Defaults to name if omitted. 286 286 * 'class' (string) - The class attribute value for select element. 287 * 'option_class_slug' (bool|int) - Adds category slug to option with 'cat-' prefix. 287 288 * 'selected' (int) - Which category ID is selected. 288 289 * 'taxonomy' (string) - The name of the taxonomy to retrieve. Defaults to category. 289 290 * … … 307 308 'selected' => 0, 'hierarchical' => 0, 308 309 'name' => 'cat', 'id' => '', 309 310 'class' => 'postform', 'depth' => 0, 311 'option_class_slug' => false, 310 312 'tab_index' => 0, 'taxonomy' => 'category', 311 313 'hide_if_empty' => false 312 314 ); … … 946 948 */ 947 949 function start_el( &$output, $category, $depth, $args, $id = 0 ) { 948 950 $pad = str_repeat(' ', $depth * 3); 949 951 $option_class = ( $args['option_class_slug'] == 'true' ) ? 'cat-'.$category->slug : ''; 950 952 $cat_name = apply_filters('list_cats', $category->name, $category); 951 $output .= "\t<option class=\"level-$depth\" value=\"".$category->term_id."\""; 953 954 $output .= "\t<option class=\"level-$depth $option_class\" value=\"".$category->term_id."\""; 952 955 if ( $category->term_id == $args['selected'] ) 953 956 $output .= ' selected="selected"'; 954 957 $output .= '>';