searchwp\source\post\attributes\comments\args
4.0.0以降
インデックス作成中に投稿からコメントを取得するために使用される引数を制御します。
パラメータ
| タイプ | パラメータ | デフォルト | 提供開始 | ||||||
|---|---|---|---|---|---|---|---|---|---|
| 配列 | $comments_args |
現在の投稿の post_id コードを含む配列 |
4.0.0 |
||||||
| 配列 |
$args
|
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 | |
| // 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 ); |

