searchwp\swp_query\args
Desde: 4.0.0
Sumário
Modifique os argumentos usados ao instanciar SWP_Query.
Parâmetros
| Tipo | Parâmetro | Padrão | Desde |
|---|---|---|---|
| Array | $args |
Os argumentos enviados para esta instanciação | 4.0.0 |
Exemplos
Todos os hooks devem ser adicionados a seu plugin personalizado SearchWP Customizations Plugin.
Restringir resultados a Posts e Páginas
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 | |
| // Restrict results to Posts and Pages for SearchWP's SWP_Query. | |
| add_filter( 'searchwp\swp_query\args', function( $args ) { | |
| $args['post_type'] = [ 'post', 'page' ]; | |
| return $args; | |
| } ); |

