Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $args = array(
- 'post_type' => 'job-vacancies',
- 'posts_per_page' => -1,
- 'order' => 'ASC',
- );
- if (isset($_POST['region_select']) && isset($_POST['job_cat'])) {
- $args['tax_query'] = array(
- array(
- 'taxonomy' => 'jobs',
- 'field' => 'id',
- 'terms' => $_POST['job_cat']
- ),
- array(
- 'taxonomy' => 'region',
- 'field' => 'id',
- 'terms' => $_POST['region_select']
- )
- );
- }
- if (isset($_POST['region_select']) == '' || isset($_POST['job_cat'])) {
- $args['tax_query'] = array(
- array(
- 'taxonomy' => 'jobs',
- 'field' => 'id',
- 'terms' => $_POST['job_cat']
- )
- );
- }
- if (isset($_POST['region_select']) || isset($_POST['job_cat']) == '') {
- $args['tax_query'] = array(
- array(
- 'taxonomy' => 'region',
- 'field' => 'id',
- 'terms' => $_POST['region_select']
- )
- );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement