Skip to content

Instantly share code, notes, and snippets.

@jchristopher
Created October 28, 2014 11:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jchristopher/093151a7047fd1fb9fb0 to your computer and use it in GitHub Desktop.
Save jchristopher/093151a7047fd1fb9fb0 to your computer and use it in GitHub Desktop.
Use searchwp_query_results to modify the results returned by SearchWP
<?php
function my_searchwp_query_results( $post_ids, $args ) {
// $post_ids is an array of post IDs returned by the search, you can
// manipulate it by adding/removing your own IDs
return $post_ids;
}
add_filter( 'searchwp_query_results', 'my_searchwp_query_results', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment