Add 'Select' text to the dropdowns. Props Joseph Scott.
git-svn-id: http://svn.automattic.com/wordpress/branches/2.2@5382 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
aa19ffe126
commit
d7a6781cc6
|
@ -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);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Reference in New Issue