Add 'Select' text to the dropdowns. Props Joseph Scott.

git-svn-id: https://develop.svn.wordpress.org/trunk@5381 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2007-05-04 02:23:49 +00:00
parent 53ee688f08
commit 7c61a32074
1 changed files with 6 additions and 4 deletions

View File

@ -344,7 +344,7 @@ function wp_widget_archives($args) {
if($d) { if($d) {
?> ?>
<select name="archive-dropdown" onChange='document.location.href=this.options[this.selectedIndex].value;'> <?php wp_get_archives('type=monthly&format=option'); ?> </select> <select name="archive-dropdown" onChange='document.location.href=this.options[this.selectedIndex].value;'> <option value=""><?php _e('Select Month'); ?></option> <?php wp_get_archives('type=monthly&format=option'); ?> </select>
<?php <?php
} else { } else {
?> ?>
@ -539,13 +539,15 @@ function wp_widget_categories($args) {
$cat_args = "orderby=name&show_count={$c}&hierarchical={$h}"; $cat_args = "orderby=name&show_count={$c}&hierarchical={$h}";
if($d) { if($d) {
wp_dropdown_categories($cat_args); wp_dropdown_categories($cat_args . '&show_option_none= ' . __('Select Category'));
?> ?>
<script lang='javascript'><!-- <script lang='javascript'><!--
var dropdown = document.getElementById("cat"); var dropdown = document.getElementById("cat");
function onCatChange() { function onCatChange() {
location.href = "<?php echo get_option('siteurl'); ?>/?cat="+dropdown.options[dropdown.selectedIndex].value; if ( dropdown.options[dropdown.selectedIndex].value > 0 ) {
location.href = "<?php echo get_option('siteurl'); ?>/?cat="+dropdown.options[dropdown.selectedIndex].value;
}
} }
dropdown.onchange = onCatChange; dropdown.onchange = onCatChange;
--></script> --></script>
@ -893,4 +895,4 @@ function wp_widgets_init() {
add_action('init', 'wp_widgets_init', 1); add_action('init', 'wp_widgets_init', 1);
?> ?>