X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/af50974463450c98503e763a7836a50e260461a9..8ab4a4532479e8db471032b51042ec8c4716d091:/wp-includes/default-widgets.php diff --git a/wp-includes/default-widgets.php b/wp-includes/default-widgets.php index 1bdadd8e..748fc9ae 100644 --- a/wp-includes/default-widgets.php +++ b/wp-includes/default-widgets.php @@ -285,10 +285,10 @@ class WP_Widget_Archives extends WP_Widget { } if ( $d ) { + $dropdown_id = "{$this->id_base}-dropdown-{$this->number}"; ?> - 'monthly', 'format' => 'option', 'show_post_count' => $c - ) ) ); -?> + ) ); + + switch ( $dropdown_args['type'] ) { + case 'yearly': + $label = __( 'Select Year' ); + break; + case 'monthly': + $label = __( 'Select Month' ); + break; + case 'daily': + $label = __( 'Select Day' ); + break; + case 'weekly': + $label = __( 'Select Week' ); + break; + default: + $label = __( 'Select Post' ); + break; + } + ?> + + + + 'name', 'show_count' => $c, 'hierarchical' => $h); + $cat_args = array( + 'orderby' => 'name', + 'show_count' => $c, + 'hierarchical' => $h + ); if ( $d ) { - $cat_args['show_option_none'] = __('Select Category'); + static $first_dropdown = true; + + $dropdown_id = ( $first_dropdown ) ? 'cat' : "{$this->id_base}-dropdown-{$this->number}"; + $first_dropdown = false; + + echo ''; + + $cat_args['show_option_none'] = __( 'Select Category' ); + $cat_args['id'] = $dropdown_id; /** * Filter the arguments for the Categories widget drop-down. @@ -575,13 +609,15 @@ class WP_Widget_Categories extends WP_Widget { @@ -1266,6 +1302,7 @@ class WP_Widget_Tag_Cloud extends WP_Widget { } public function update( $new_instance, $old_instance ) { + $instance = array(); $instance['title'] = strip_tags(stripslashes($new_instance['title'])); $instance['taxonomy'] = stripslashes($new_instance['taxonomy']); return $instance; @@ -1323,7 +1360,26 @@ class WP_Widget_Tag_Cloud extends WP_Widget { if ( !empty($instance['title']) ) echo $args['before_title'] . $instance['title'] . $args['after_title']; - wp_nav_menu( array( 'fallback_cb' => '', 'menu' => $nav_menu ) ); + $nav_menu_args = array( + 'fallback_cb' => '', + 'menu' => $nav_menu + ); + + /** + * Filter the arguments for the Custom Menu widget. + * + * @since 4.2.0 + * + * @param array $nav_menu_args { + * An array of arguments passed to wp_nav_menu() to retrieve a custom menu. + * + * @type callback|bool $fallback_cb Callback to fire if the menu doesn't exist. Default empty. + * @type mixed $menu Menu ID, slug, or name. + * } + * @param stdClass $nav_menu Nav menu object for the current menu. + * @param array $args Display arguments for the current widget. + */ + wp_nav_menu( apply_filters( 'widget_nav_menu_args', $nav_menu_args, $nav_menu, $args ) ); echo $args['after_widget']; }