Ticket #18650: 18650.2.patch
| File 18650.2.patch, 3.0 KB (added by , 13 years ago) |
|---|
-
wp-includes/default-widgets.php
244 244 $title = apply_filters('widget_title', empty($instance['title']) ? __('Archives') : $instance['title'], $instance, $this->id_base); 245 245 246 246 echo $before_widget; 247 if ( $title ) 248 echo $before_title . $title . $after_title; 247 if ( $title ) { 248 echo $before_title; 249 if ( $d ) 250 echo '<label for="' . $this->id_base . '-dropdown-' . $this->number . '">' . $title . '</label>'; 251 else 252 echo $title; 253 echo $after_title; 254 } 249 255 250 256 if ( $d ) { 251 257 ?> 252 <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> 258 <select id="<?php echo $this->id_base . '-dropdown-' . $this->number; ?>" name="archive-dropdown" onchange='document.location.href=this.options[this.selectedIndex].value;'> 259 <option value=""><?php echo esc_attr( __( 'Select Month' ) ); ?></option> 260 <?php wp_get_archives( apply_filters( 'widget_archives_dropdown_args', array( 'type' => 'monthly', 'format' => 'option', 'show_post_count' => $c ) ) ); ?> 261 </select> 253 262 <?php 254 263 } else { 255 264 ?> 256 265 <ul> 257 <?php wp_get_archives(apply_filters('widget_archives_args', array('type' => 'monthly', 'show_post_count' => $c))); ?>266 <?php wp_get_archives( apply_filters( 'widget_archives_args', array( 'type' => 'monthly', 'show_post_count' => $c ) ) ); ?> 258 267 </ul> 259 268 <?php 260 269 } … … 454 463 $d = ! empty( $instance['dropdown'] ) ? '1' : '0'; 455 464 456 465 echo $before_widget; 457 if ( $title ) 458 echo $before_title . $title . $after_title; 466 if ( $title ) { 467 echo $before_title; 468 if ( $d ) 469 echo '<label for="' . $this->id_base . '-dropdown-' . $this->number . '">' . $title . '</label>'; 470 else 471 echo $title; 472 echo $after_title; 473 } 459 474 460 $cat_args = array( 'orderby' => 'name', 'show_count' => $c, 'hierarchical' => $h);475 $cat_args = array( 'orderby' => 'name', 'show_count' => $c, 'hierarchical' => $h ); 461 476 462 477 if ( $d ) { 463 478 $cat_args['show_option_none'] = __('Select Category'); 464 wp_dropdown_categories(apply_filters('widget_categories_dropdown_args', $cat_args)); 479 $cat_args['id'] = $this->id_base . '-dropdown-' . $this->number; 480 wp_dropdown_categories( apply_filters( 'widget_categories_dropdown_args', $cat_args ) ); 465 481 ?> 466 482 467 483 <script type='text/javascript'> 468 484 /* <![CDATA[ */ 469 var dropdown = document.getElementById(" cat");485 var dropdown = document.getElementById("<?php echo $this->id_base . '-dropdown-' . $this->number; ?>"); 470 486 function onCatChange() { 471 487 if ( dropdown.options[dropdown.selectedIndex].value > 0 ) { 472 488 location.href = "<?php echo home_url(); ?>/?cat="+dropdown.options[dropdown.selectedIndex].value;