WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
Line | Code |
---|---|
1365 |
|
1366 | /** |
1367 | * Filters the prefix that indicates that a search term should be excluded from results. |
1368 | * |
1369 | * @since 4.7.0 |
1370 | * |
1371 | * @param string $exclusion_prefix The prefix. Default '-'. Returning |
1372 | * an empty value disables exclusions. |
1373 | */ |
1374 | $exclusion_prefix = apply_filters( 'wp_query_search_exclusion_prefix', '-' ); |
1375 |
|
1376 | foreach ( $q['search_terms'] as $term ) { |
1377 | // If there is an $exclusion_prefix, terms prefixed with it should be excluded. |
1378 | $exclude = $exclusion_prefix && ( substr( $term, 0, 1 ) === $exclusion_prefix ); |
1379 | if ( $exclude ) { |
1380 | $like_op = 'NOT LIKE'; |
1381 | $andor_op = 'AND'; |
1382 | $term = substr( $term, 1 ); |
1383 | } else { |