Ticket #13258: wp-dropdown-categories-slug-value.patch
| File wp-dropdown-categories-slug-value.patch, 1.2 KB (added by , 14 years ago) |
|---|
-
wp-includes/category-template.php
937 937 $pad = str_repeat(' ', $depth * 3); 938 938 939 939 $cat_name = apply_filters('list_cats', $category->name, $category); 940 $output .= "\t<option class=\"level-$depth\" value=\"".$category->term_id."\""; 941 if ( $category->term_id == $args['selected'] ) 940 941 if( !empty($args['value']) ){ 942 $value = ($args['value']=='slug' ? $category->slug : $category->term_id ); 943 }else{ 944 $value = ( $category->taxonomy != 'category' ? $category->slug : $category->term_id ); 945 } 946 947 $output .= "\t<option class=\"level-$depth\" value=\"".$value."\""; 948 if ( $value == $args['selected'] ) 942 949 $output .= ' selected="selected"'; 943 950 $output .= '>'; 944 951 $output .= $pad.$cat_name; 945 952 if ( $args['show_count'] ) 946 953 $output .= ' ('. $category->count .')'; 954 if ( $args['show_last_update'] ) { 955 $format = 'Y-m-d'; 956 $output .= ' ' . gmdate($format, $category->last_update_timestamp); 957 } 947 958 $output .= "</option>\n"; 948 959 } 949 960 }