I am having trouble getting the show_option_all and show_option_none arguments to work with get_terms_dropdown.

I have used them with wp_dropdown_categories. Hopefully they can work with get_terms_dropdown and it is just my syntax that is wrong.

Below is my code - without the show_option_all and show_option_none commands.

Any suggestions?

<form action="<?php bloginfo('url'); ?>" method="get">
    <div>
<?php
$taxonomies = array('TAXONOMY NAME');
$args = array('orderby'=>'name','hide_empty'=>true);
$select = get_terms_dropdown($taxonomies, $args);

$select = preg_replace("#<select([^>]*)>#", "<select$1 onchange='return this.form.submit()'>", $select);
echo $select;
?>
    <noscript><div><input type="submit" value="Näytä" /></div></noscript>
    </div></form>
<?php
function get_terms_dropdown($taxonomies, $args){
    $myterms = get_terms($taxonomies, $args);
    $output ="<select name='TAXONOMY SLUG'>";
    foreach($myterms as $term){
        $root_url = get_bloginfo('url');
        $term_taxonomy=$term->taxonomy;
        $term_slug=$term->slug;
        $term_name =$term->name;
        $link = $term_slug;
        $output .="<option value='".$link."'>".$term_name."</option>";
    }
    $output .="</select>";
return $output;
}
?>
link|improve this question
feedback

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
or
required, but never shown

Browse other questions tagged or ask your own question.