searchwp\source\post\attributes\comments\args
Desde: 4.0.0
Sumário
Controle os argumentos usados para recuperar Comentários de um post durante a indexação.
Parâmetros
| Tipo | Parâmetro | Padrão | Desde | ||||||
|---|---|---|---|---|---|---|---|---|---|
| Array | $comments_args |
Matriz com o código post_id definido para a postagem atual |
4.0.0 |
||||||
| Array |
$args
|
4.0.0 |
|||||||
Exemplos
All hooks should be added to your custom SearchWP Customizations Plugin.
Incluir comentários não aprovados ao indexar
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 ); |

