Created
March 26, 2020 18:17
-
-
Save jchristopher/68ca2758b9e77e71e4d35a994ffb1868 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