SearchWP

Available since: 3.0

searchwp_term_highlight_break_on_first_match

View Parameters »

When highlighting is enabled SearchWP will stop finding terms to highlight once the first match is found. This is because search terms can be modified by other code potentially leading to unwanted highlights appearing. You can control this behavior with the following hook:

<?php
// Stop SearchWP from breaking highlight on first match.
add_filter( 'searchwp_term_highlight_break_on_first_match', '__return_false' );
view raw functions.php hosted with ❤ by GitHub

Parameters

Parameter Type Description
$break_on_first_match Boolean

Whether to stop highlighting on the first match