searchwp\source\post\attributes\comments\args
Da: 4.0.0
Indice
Controlla gli argomenti utilizzati per recuperare i Commenti di un post durante l'indicizzazione.
Parametri
| Tipo | Parametro | Predefinito | Da | ||||||
|---|---|---|---|---|---|---|---|---|---|
| Array | $comments_args |
Array con post_id definito per il post corrente |
4.0.0 |
||||||
| Array |
$args
|
4.0.0 |
|||||||
Esempi
Tutti gli hook dovrebbero essere aggiunti al tuo plugin personalizzato SearchWP Customizations Plugin.
Includi commenti non approvati durante l'indicizzazione
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 ); |
