-
-
Save searchwpgists/d51f06493041fc37278cd307fddef00f to your computer and use it in GitHub Desktop.
Restrict results to Posts and Pages for SearchWP's SWP_Query
This file contains 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; | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment