Created
March 9, 2018 11:06
-
-
Save JoeHana/4c267724f9312362d8dc3e3779e62e63 to your computer and use it in GitHub Desktop.
Add custom taxonomy to search form
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add custom taxonomy to search form | |
*/ | |
add_filter( 'wpsight_get_search_fields', 'custom_wpsight_get_search_fields' ); | |
function custom_wpsight_get_search_fields( $fields ) { | |
$fields['feature'] = array( | |
'data' => array( | |
// wp_dropdown_categories() options | |
'taxonomy' => 'feature', | |
'show_option_none' => __( 'Feature', 'wpcasa' ), | |
'option_none_value' => '', | |
'hierarchical' => 1, | |
'orderby' => 'name', | |
'order' => 'ASC' | |
), | |
'type' => 'taxonomy_select', | |
'class' => 'width-1-5', | |
'priority' => 50 | |
); | |
return $fields; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment