Ticket #18650: 18650-patch.diff
File 18650-patch.diff, 2.5 KB (added by , 13 years ago) |
---|
-
wp-includes/default-widgets.php
225 225 $title = apply_filters('widget_title', empty($instance['title']) ? __('Archives') : $instance['title'], $instance, $this->id_base); 226 226 227 227 echo $before_widget; 228 if ( $title ) 229 echo $before_title . $title . $after_title; 230 228 if ( $title ) { 229 echo $before_title; 230 if ( $d ) { 231 echo '<label for="' . $this->id_base . '-dropdown-' . $this->number . '">' . $title . '</label>'; 232 } else { 233 echo $title; 234 } 235 echo $after_title; 236 } 231 237 if ( $d ) { 232 238 ?> 233 <select name="archive-dropdown" onchange='document.location.href=this.options[this.selectedIndex].value;'> <option value=""><?php echo esc_attr(__('Select Month')); ?></option> <?php wp_get_archives(apply_filters('widget_archives_dropdown_args', array('type' => 'monthly', 'format' => 'option', 'show_post_count' => $c))); ?> </select>239 <select id="<?php echo $this->id_base . '-dropdown-' . $this->number; ?>" name="archive-dropdown" onchange='document.location.href=this.options[this.selectedIndex].value;'> <option value=""><?php echo esc_attr(__('Select Month')); ?></option> <?php wp_get_archives(apply_filters('widget_archives_dropdown_args', array('type' => 'monthly', 'format' => 'option', 'show_post_count' => $c))); ?> </select> 234 240 <?php 235 241 } else { 236 242 ?> … … 431 437 $d = $instance['dropdown'] ? '1' : '0'; 432 438 433 439 echo $before_widget; 434 if ( $title ) 435 echo $before_title . $title . $after_title; 440 if ( $title ) { 441 echo $before_title; 442 if ( $d ) { 443 echo '<label for="' . $this->id_base . '-dropdown-' . $this->number . '">' . $title . '</label>'; 444 } else { 445 echo $title; 446 } 447 echo $after_title; 448 } 436 449 437 450 $cat_args = array('orderby' => 'name', 'show_count' => $c, 'hierarchical' => $h); 438 451 439 452 if ( $d ) { 440 453 $cat_args['show_option_none'] = __('Select Category'); 454 $cat_args['id'] = $this->id_base . '-dropdown-' . $this->number; 441 455 wp_dropdown_categories(apply_filters('widget_categories_dropdown_args', $cat_args)); 442 456 ?> 443 457 444 458 <script type='text/javascript'> 445 459 /* <![CDATA[ */ 446 var dropdown = document.getElementById(" cat");460 var dropdown = document.getElementById("<?php echo $this->id_base . '-dropdown-' . $this->number; ?>"); 447 461 function onCatChange() { 448 462 if ( dropdown.options[dropdown.selectedIndex].value > 0 ) { 449 463 location.href = "<?php echo home_url(); ?>/?cat="+dropdown.options[dropdown.selectedIndex].value;