searchwp\swp_query\args
Seit: 4.0.0
Ändern Sie die Argumente, die beim Instanziieren von SWP_Query verwendet werden.
Parameter
| Typ | Parameter | Standard | Seit |
|---|---|---|---|
| Array | $args |
Die übermittelten Argumente für diese Instanziierung | 4.0.0 |
Beispiele
All hooks should be added to your custom SearchWP Customizations Plugin.
Ergebnisse auf Beiträge und Seiten beschränken
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; | |
| } ); |

