Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- if ( !empty( $type ) ) {
- if (!in_array('all', $type) ) {
- $args['tax_query'] = array(
- array(
- 'taxonomy' => 'job-type',
- 'field' => 'slug',
- 'terms' => $type,
- ),
- );
- } else {
- $term_id = [];
- $_terms = get_terms( ['taxonomy' => 'job-type', 'hide_empty' => true] );
- foreach ( $_terms as $_term ) {
- $term_id[] = $_term->term_id;
- }
- $args['tax_query'] = array(
- array(
- 'taxonomy' => 'job-type',
- 'field' => 'term_id',
- 'terms' => $term_id,
- ),
- );
- }
- }
- if ( !empty( $industry ) ) {
- if ( !in_array('all', $industry )) {
- $args['tax_query'] = array(
- array(
- 'taxonomy' => 'industry',
- 'field' => 'slug',
- 'terms' => $industry,
- ),
- );
- } else {
- $term_id = [];
- $_terms = get_terms( ['taxonomy' => 'industry', 'hide_empty' => true] );
- foreach ( $_terms as $_term ) {
- $term_id[] = $_term->term_id;
- }
- $args['tax_query'] = array(
- array(
- 'taxonomy' => 'industry',
- 'field' => 'term_id',
- 'terms' => $term_id,
- ),
- );
- }
- }
- if ( !empty( $location ) ) {
- if ( !in_array('all', $location ) ) {
- $args['tax_query'] = array(
- array(
- 'taxonomy' => 'job-location',
- 'field' => 'slug',
- 'terms' => $location,
- ),
- );
- } else {
- $term_id = [];
- $_terms = get_terms( ['taxonomy' => 'job-location', 'hide_empty' => true] );
- foreach ( $_terms as $_term ) {
- $term_id[] = $_term->term_id;
- }
- $args['tax_query'] = array(
- array(
- 'taxonomy' => 'job-location',
- 'field' => 'term_id',
- 'terms' => $term_id,
- ),
- );
- }
- }
- if ( !empty( $role ) ) {
- if (!in_array('all', $role ) ) {
- $args['tax_query'] = array(
- array(
- 'taxonomy' => 'job-speciality',
- 'field' => 'slug',
- 'terms' => $role,
- ),
- );
- } else {
- $term_id = [];
- $_terms = get_terms( ['taxonomy' => 'job-speciality', 'hide_empty' => true] );
- foreach ( $_terms as $_term ) {
- $term_id[] = $_term->term_id;
- }
- $args['tax_query'] = array(
- array(
- 'taxonomy' => 'job-speciality',
- 'field' => 'term_id',
- 'terms' => $term_id,
- ),
- );
- }
- }
- if ( !empty( $ql ) ) {
- if ( !in_array('all', $ql ) ) {
- $args['meta_query'] = array(
- array(
- 'key' => 'qualification',
- 'value' => $ql,
- 'compare' => 'IN',
- ),
- );
- } else {
- $args['meta_query'] = array(
- array(
- 'key' => 'qualification',
- 'compare' => 'EXISTS',
- ),
- );
- }
- }
- if ( !empty( $experience ) ) {
- if ( !in_array('all', $experience ) ) {
- $args['meta_query'] = array(
- array(
- 'key' => 'experience',
- 'value' => strval( $experience ),
- 'compare' => 'IN',
- ),
- );
- } else {
- $args['meta_query'] = array(
- array(
- 'key' => 'experience',
- 'compare' => 'EXISTS',
- ),
- );
- }
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement