SearchWP Documentation

Sehen Sie sich die Installationsanleitung an, durchsuchen Sie die Wissensdatenbank und erfahren Sie mehr über die vielen Hooks von SearchWP

searchwp\source\post\attributes\comment

Seit: 4.0.0

Inhaltsverzeichnis

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

<?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;
} );

Anwendung dieses Codes