Advertisement
Beee

searchwp-config.php

Dec 2nd, 2015
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. <?php
  2.  
  3. function my_searchwp_include( $ids ) {
  4. if ( isset( $_REQUEST['soort'] ) ) {
  5. // limit the results to all of the chosen sort documents
  6. $args = array(
  7. 'post_type' => 'any',
  8. 'nopaging' => true,
  9. 'fields' => 'ids',
  10. 'tax_query' => array(
  11. array(
  12. 'taxonomy' => 'soort',
  13. 'field' => 'slug',
  14. 'terms' => $_REQUEST['soort'],
  15. ),
  16. ),
  17. );
  18. $soort_ids = get_posts( $args );
  19. $ids = array_merge( $ids, $soort_ids );
  20. $ids = array_unique( $ids );
  21. }
  22. return $ids;
  23. }
  24. add_filter( 'searchwp_include', 'my_searchwp_include' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement