Last active
July 21, 2017 14:52
-
-
Save jchristopher/ec83a77e9489c0420a40f4b739e49df4 to your computer and use it in GitHub Desktop.
SearchWP Related default arguments for getter
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 | |
| // Use the saved keywords from the meta box | |
| $keywords = get_post_meta( get_the_ID(), $searchwp_related->meta_key, true ); | |
| $defaults = array( | |
| 'engine' => 'default', // Engine to use | |
| 's' => $keywords, // Terms to search | |
| 'fields' => 'all', // Return post objects, use 'ids' to return IDs | |
| 'posts_per_page' => 3, // How many results to return | |
| 'log' => false, // Log the search? | |
| 'post__in' => array(), // Limit results pool? | |
| 'post__not_in' => array() // Exclude posts from results? | |
| ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment