I have custom post type that is currently using the wp_dropdown_categories()
function within a WP search form so people will be able to filter by salary band and job type.
Is there an equivalent function so a user can apply filters with input checkbox elements instead of a <select>
element, so they can choose more than one job type or salary level when undertaking a search?
I can't seem to find anything in the developer docs.
What I'm looking for is something to allow checkboxes that would replace the dropdown element that uses select options in the code below.
<form method="get" action="<?php echo esc_url(site_url('/')); ?>">
<div id="form-wrapper">
<label id="searchlabel" for="s">Search</label>
<input id="s" name="s" type="search">
<input type="hidden" name="post_type" value="jobs" />
<?php wp_dropdown_categories( array(
'taxonomy' => 'salary_level', // taxonomy slug
'name' => 'salary_level', // taxonomy slug
'class' => 'jobsearch-select',
'value_field' => 'slug',
'selected' => get_query_var( 'salary_level' ),
'hierarchical' => true, // place each term under their own parent
'show_option_all' => 'Select Salary Band',
) ); ?>
<input class="td search-jobs-button" type="submit" value="Search Jobs">
</div>
</form>
Thanks in advance
Emily.