Last active
April 26, 2019 15:13
-
-
Save jchristopher/53d7be8b8075a6b2417ebf8c988bc15d to your computer and use it in GitHub Desktop.
Control which occurrence is used when SearchWP highlights results
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 | |
// Tell SearchWP to highlight the second occurrence, not the first. | |
add_filter( 'searchwp_term_highlight_occurrence', function( $occurrence, $args ) { | |
return 2; | |
}, 20, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment