wp_query_search_exclusion_prefix

wp_query_search_exclusion_prefix

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: wordpress-6.7.1

apply_filters('wp_query_search_exclusion_prefix') is found 1 times:

  • /wp-includes/class-wp-query.php line 1460
    		 *
    		 * @param string $exclusion_prefix The prefix. Default '-'. Returning
    		 *                                 an empty value disables exclusions.
    		 */
    		$exclusion_prefix = apply_filters( 'wp_query_search_exclusion_prefix', '-' );
    
    		foreach ( $q['search_terms'] as $term ) {
    			// If there is an $exclusion_prefix, terms prefixed with it should be excluded.
    			$exclude = $exclusion_prefix && str_starts_with( $term, $exclusion_prefix );
    			if ( $exclude ) {
    				$like_op  = 'NOT LIKE';