searchwp\source\post\attributes\comment
Seit: 4.0.0
Passen Sie einen Kommentar an, bevor er indiziert wird.
Parameter
| Typ | Parameter | Standard | Seit |
|---|---|---|---|
| Objekt | $kommentar |
Der zu indizierende Kommentar | 4.0.0 |
Beispiele
All hooks should be added to your custom SearchWP Customizations Plugin.
Füge zusätzliche Inhalte zum Kommentar während der Indizierung hinzu
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; | |
| } ); |

