searchwp\source\post\attributes\comment
Depuis : 4.0.0
Table des matières
Personnaliser un commentaire avant qu'il ne soit indexé.
Paramètres
| Type | Paramètre | Défaut | Depuis |
|---|---|---|---|
| Objet | $comment |
Le commentaire indexé | 4.0.0 |
Exemples
Tous les hooks doivent être ajoutés à votre plugin personnalisé SearchWP Customizations Plugin.
Ajouter du contenu supplémentaire au commentaire lors de l'indexation
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; | |
| } ); |

