searchwp\swp_query\args
Da: 4.0.0
Indice
Modifica gli argomenti utilizzati durante l'istanziazione di SWP_Query.
Parametri
| Tipo | Parametro | Predefinito | Da |
|---|---|---|---|
| Array | $args |
Gli argomenti inviati per questa istanziazione | 4.0.0 |
Esempi
All hooks should be added to your custom SearchWP Customizations Plugin.
Limita i risultati a Post e Pagine
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; | |
| } ); |

