From 569a47075ea28a47baf274ffb021f9669f2b43cc Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 23 Feb 2015 16:31:31 +0000 Subject: [PATCH] Add missing labels to Archives and Categories dropdown widgets. props joedolson, jlevandowski, DrewAPicture, SergeyBiryukov. fixes #18650. git-svn-id: https://develop.svn.wordpress.org/trunk@31520 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/default-widgets.php | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/src/wp-includes/default-widgets.php b/src/wp-includes/default-widgets.php index 6f197a321f..1a739851ee 100644 --- a/src/wp-includes/default-widgets.php +++ b/src/wp-includes/default-widgets.php @@ -285,8 +285,10 @@ class WP_Widget_Archives extends WP_Widget { } if ( $d ) { + $dropdown_id = "{$this->id_base}-dropdown-{$this->number}"; ?> - '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. @@ -595,13 +609,15 @@ class WP_Widget_Categories extends WP_Widget {