Available since: 1.0
searchwp_query_results
View Parameters »This hook allows you to directly filter the results returned by SearchWP. This hook provides you with an array of post IDs that you can manipulate before they are returned upstream, allowing you to inject your own post IDs where you would like.
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 | |
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 ); |
Parameters
Parameter | Type | Description |
---|---|---|
$post_ids |
Array |
The post IDs retrieved by SearchWP |
$args |
Array |
SearchWP arguments |