Skip to content

Instantly share code, notes, and snippets.

@jchristopher
Created April 11, 2014 15:25
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 jchristopher/10477709 to your computer and use it in GitHub Desktop.
Save jchristopher/10477709 to your computer and use it in GitHub Desktop.
<?php
// add support for strings like M&M in SearchWP
function my_searchwp_term_pattern_whitelist( $patterns ) {
$patterns[] = "/\\b([[:alnum:]]+\\s?(?:&\\s?[[:alnum:]]+)+)/is";
}
add_filter( 'searchwp_term_pattern_whitelist', 'my_searchwp_term_pattern_whitelist' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment