Advertisement
Guest User

Untitled

a guest
Nov 3rd, 2022
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. $args = array(
  2. 'post_type' => 'job-vacancies',
  3. 'posts_per_page' => -1,
  4. 'order' => 'ASC',
  5. );
  6.  
  7. if (isset($_POST['region_select']) && isset($_POST['job_cat'])) {
  8. $args['tax_query'] = array(
  9. array(
  10. 'taxonomy' => 'jobs',
  11. 'field' => 'id',
  12. 'terms' => $_POST['job_cat']
  13. ),
  14. array(
  15. 'taxonomy' => 'region',
  16. 'field' => 'id',
  17. 'terms' => $_POST['region_select']
  18. )
  19. );
  20. }
  21.  
  22.  
  23. if (isset($_POST['region_select']) == '' || isset($_POST['job_cat'])) {
  24. $args['tax_query'] = array(
  25. array(
  26. 'taxonomy' => 'jobs',
  27. 'field' => 'id',
  28. 'terms' => $_POST['job_cat']
  29. )
  30. );
  31. }
  32.  
  33. if (isset($_POST['region_select']) || isset($_POST['job_cat']) == '') {
  34. $args['tax_query'] = array(
  35. array(
  36. 'taxonomy' => 'region',
  37. 'field' => 'id',
  38. 'terms' => $_POST['region_select']
  39. )
  40. );
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement