Code Duplication    Length = 17-17 lines in 2 locations

geodirectory-functions/shortcode_functions.php 1 location

@@ 621-637 (lines=17) @@
618
    }
619
    $with_no_results = !empty($args['without_no_results']) ? false : true;
620
621
    if (!empty($category) && isset($category[0]) && $category[0] != '0') {
622
        $category_taxonomy = geodir_get_taxonomies($post_type);
623
624
        ######### WPML #########
625
        if (function_exists('icl_object_id')) {
626
            $category = gd_lang_object_ids($category, $category_taxonomy[0]);
627
        }
628
        ######### WPML #########
629
630
        $tax_query = array(
631
            'taxonomy' => $category_taxonomy[0],
632
            'field' => 'id',
633
            'terms' => $category
634
        );
635
636
        $query_args['tax_query'] = array($tax_query);
637
    }
638
639
    global $gridview_columns_widget, $geodir_is_widget_listing;
640

geodirectory-functions/general_functions.php 1 location

@@ 3310-3326 (lines=17) @@
3307
    }
3308
    $with_no_results = !empty($instance['without_no_results']) ? false : true;
3309
3310
    if (!empty($category) && $category[0] != '0') {
3311
        $category_taxonomy = geodir_get_taxonomies($post_type);
3312
3313
        ######### WPML #########
3314
        if (function_exists('icl_object_id')) {
3315
            $category = gd_lang_object_ids($category, $category_taxonomy[0]);
3316
        }
3317
        ######### WPML #########
3318
3319
        $tax_query = array(
3320
            'taxonomy' => $category_taxonomy[0],
3321
            'field' => 'id',
3322
            'terms' => $category
3323
        );
3324
3325
        $query_args['tax_query'] = array($tax_query);
3326
    }
3327
3328
    global $gridview_columns_widget, $geodir_is_widget_listing;
3329