searchwp\source\post\attributes\comment
Da: 4.0.0
Indice
Personalizza un Commento prima che venga indicizzato.
Parametri
| Tipo | Parametro | Predefinito | Da |
|---|---|---|---|
| Oggetto | $comment |
Il commento indicizzato | 4.0.0 |
Esempi
Tutti gli hook dovrebbero essere aggiunti al tuo plugin personalizzato SearchWP Customizations Plugin.
Aggiungi contenuto aggiuntivo al commento durante l'indicizzazione
This file contains hidden or 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; | |
| } ); |
