searchwp\source\post\attributes\comment
4.0.0以降
コメントをインデックスする前にカスタマイズします。
パラメータ
| タイプ | パラメータ | デフォルト | 提供開始 |
|---|---|---|---|
| オブジェクト | $comment |
インデックス作成中のコメント | 4.0.0 |
例
All hooks should be added to your custom SearchWP Customizations Plugin.
インデックス作成中にコメントに追加コンテンツを追加
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; | |
| } ); |

