Created
January 23, 2015 16:48
-
-
Save jchristopher/cf7e690e0c8d24f2b497 to your computer and use it in GitHub Desktop.
Customize the SearchWP Regex Whitelist
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 | |
function my_searchwp_term_pattern_whitelist( $whitelist ) { | |
$my_whitelist = array( | |
"/\\b(IT)\\b/u", // always keep "IT" (all caps only!) | |
); | |
// we want our pattern to be considered the most specific | |
// so that false positive matches do not interfere | |
$whitelist = array_merge( $my_whitelist, $whitelist ); | |
return $whitelist; | |
} | |
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