Available since: 2.8.4
searchwp_indexer_comment
View Parameters »By default SearchWP indexes only comment content when comments have been added to a search engine configuration.
Related: searchwp_include_comment_author
and searchwp_include_comment_email
You can use this hook to modify the entire comment object that SearchWP analyzes when indexing:
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_filter( 'searchwp_indexer_comment', function( $comment ) { | |
// TODO: manipulate the $comment object in any way you see fit | |
// @link https://developer.wordpress.org/reference/classes/wp_comment/ | |
return $comment; | |
} ); |
Parameters
Parameter | Type | Description |
---|---|---|
$comment |
Object |
The comment being indexed |