-
-
Save searchwpgists/0681b2e75c93d128fe7bf03ac37274d6 to your computer and use it in GitHub Desktop.
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 | |
// @link https://searchwp.com/documentation/knowledge-base/comparing-index-source-mods/ | |
add_filter( 'searchwp\query\mods', function( $mods ) { | |
// Exclude Pages with 'coffee' in the Title. | |
$source = \SearchWP\Utils::get_post_type_source_name( 'page' ); | |
$mod = new \SearchWP\Mod( $source ); | |
$mod->set_where( [ [ | |
'column' => 'post_title', | |
'value' => 'coffee', | |
'compare' => 'LIKE', | |
] ] ); | |
$mods[] = $mod; | |
return $mods; | |
}, 30, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment