Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Add additional content to comment during indexing in SearchWP
<?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