wp_query_search_exclusion_prefix filter-hookWP 4.7.0

Filters the prefix that indicates that a search term should be excluded from results.

Usage

add_filter( 'wp_query_search_exclusion_prefix', 'wp_kama_query_search_exclusion_prefix_filter' );

/**
 * Function for `wp_query_search_exclusion_prefix` filter-hook.
 * 
 * @param string $exclusion_prefix The prefix. Returning an empty value disables exclusions.
 *
 * @return string
 */
function wp_kama_query_search_exclusion_prefix_filter( $exclusion_prefix ){

	// filter...
	return $exclusion_prefix;
}
$exclusion_prefix(string)
The prefix. Returning an empty value disables exclusions.
Default: '-'

Changelog

Since 4.7.0 Introduced.

Where the hook is called

WP_Query::parse_search()
wp_query_search_exclusion_prefix
wp-includes/class-wp-query.php 1398
$exclusion_prefix = apply_filters( 'wp_query_search_exclusion_prefix', '-' );

Where the hook is used in WordPress

Usage not found.