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:
parent
53ee688f08
commit
7c61a32074
|
@ -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,14 +539,16 @@ 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() {
|
||||||
|
if ( dropdown.options[dropdown.selectedIndex].value > 0 ) {
|
||||||
location.href = "<?php echo get_option('siteurl'); ?>/?cat="+dropdown.options[dropdown.selectedIndex].value;
|
location.href = "<?php echo get_option('siteurl'); ?>/?cat="+dropdown.options[dropdown.selectedIndex].value;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
dropdown.onchange = onCatChange;
|
dropdown.onchange = onCatChange;
|
||||||
--></script>
|
--></script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue