Skip to content

Instantly share code, notes, and snippets.

@xnau
Last active May 13, 2017 08:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xnau/8c46311314dbab6a866e63b845b57005 to your computer and use it in GitHub Desktop.
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
<?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