SearchWP Documentation

インストールガイドを表示したり、ナレッジベースを参照したり、SearchWPの多くのフックについて確認したりできます。

searchwp\source\post\attributes\comments\args

4.0.0以降

インデックス作成中に投稿からコメントを取得するために使用される引数を制御します。

パラメータ

タイプ パラメータ デフォルト 提供開始
配列 $comments_args 現在の投稿の post_id コードを含む配列 4.0.0
配列 $args
キー タイプ
post_id 整数 投稿ID
4.0.0

All hooks should be added to your custom SearchWP Customizations Plugin.

承認されていないコメントをインデックスに含める

<?php
// Include unapproved comments when SearchWP indexes.
add_filter( 'searchwp\source\post\attributes\comments\args', function( $comment_args, $args ) {
$args['include_unapproved'] = true;
return $args;
}, 20, 2 );

このコードの使用方法