diff --git src/wp-includes/widgets/class-wp-widget-categories.php src/wp-includes/widgets/class-wp-widget-categories.php
index 21e375eddc..f208db9481 100644
|
|
class WP_Widget_Categories extends WP_Widget { |
59 | 59 | $cat_args = array( |
60 | 60 | 'orderby' => 'name', |
61 | 61 | 'show_count' => $c, |
62 | | 'hierarchical' => $h |
| 62 | 'hierarchical' => $h, |
63 | 63 | ); |
64 | 64 | |
65 | 65 | if ( $d ) { |
| 66 | echo sprintf( '<form action="%s" method="get">', esc_url( home_url() ) ); |
66 | 67 | $dropdown_id = ( $first_dropdown ) ? 'cat' : "{$this->id_base}-dropdown-{$this->number}"; |
67 | 68 | $first_dropdown = false; |
68 | 69 | |
… |
… |
class WP_Widget_Categories extends WP_Widget { |
81 | 82 | * @param array $cat_args An array of Categories widget drop-down arguments. |
82 | 83 | */ |
83 | 84 | wp_dropdown_categories( apply_filters( 'widget_categories_dropdown_args', $cat_args ) ); |
| 85 | |
| 86 | echo '</form>'; |
84 | 87 | ?> |
85 | 88 | |
86 | 89 | <script type='text/javascript'> |
… |
… |
class WP_Widget_Categories extends WP_Widget { |
89 | 92 | var dropdown = document.getElementById( "<?php echo esc_js( $dropdown_id ); ?>" ); |
90 | 93 | function onCatChange() { |
91 | 94 | if ( dropdown.options[ dropdown.selectedIndex ].value > 0 ) { |
92 | | location.href = "<?php echo home_url(); ?>/?cat=" + dropdown.options[ dropdown.selectedIndex ].value; |
| 95 | dropdown.parentNode.submit(); |
93 | 96 | } |
94 | 97 | } |
95 | 98 | dropdown.onchange = onCatChange; |