Created
March 26, 2020 14:26
-
-
Save jchristopher/1d0fa044ec23efca5c79383d67b6e91a to your computer and use it in GitHub Desktop.
Add additional content to comment during indexing in SearchWP
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 | |
// Add additional content to comment during indexing in SearchWP. | |
add_filter( 'searchwp\source\post\attributes\comment', function( $comment ) { | |
// Add 'coffee" to the comment content so it can be searched. | |
$comment->comment_content .= ' coffee'; | |
return $comment; | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment