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

