Created
February 14, 2019 17:30
-
-
Save jchristopher/a0ac5ddbd7cb51ec5888aba0e5cbbc5b to your computer and use it in GitHub Desktop.
Tell SearchWP to use the 2nd occurrence of the search term when finding highlights
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 | |
// Use the second occurrence of the search term when finding what to highlight. | |
function my_searchwp_term_highlight_occurrence( $occurrence ) { | |
return 2; | |
} | |
apply_filters( 'searchwp_term_highlight_occurrence', 'my_searchwp_term_highlight_occurrence' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment