Last active
May 13, 2017 08:33
-
-
Save xnau/8c46311314dbab6a866e63b845b57005 to your computer and use it in GitHub Desktop.
Demonstrates setting the search element type for the Participants Database Combo Multi-Search add-on
This file contains 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 | |
// this sets the type of control to use when building the multi search control | |
add_filter( 'pdb-combo-multisearch-search_control_type', 'xnau_set_search_control_type', 10, 2 ); | |
// this sets the field type for the purpose of adding the search as a query filter | |
add_filter( 'pdbmps-field-filter', 'xnau_set_search_control_type', 10, 2 ); | |
function xnau_set_search_control_type( $form_element, $field ) | |
{ | |
if ( $field->name === 'state' ) { | |
$form_element = 'multi-checkbox'; | |
} | |
return $form_element; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment