Code Duplication    Length = 17-17 lines in 2 locations

geodirectory-functions/shortcode_functions.php 1 location

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

geodirectory-functions/general_functions.php 1 location

@@ 3698-3714 (lines=17) @@
3695
	}
3696
	$with_no_results = ! empty( $instance['without_no_results'] ) ? false : true;
3697
3698
	if ( ! empty( $category ) && $category[0] != '0' ) {
3699
		$category_taxonomy = geodir_get_taxonomies( $post_type );
3700
3701
		######### WPML #########
3702
		if ( function_exists( 'icl_object_id' ) ) {
3703
			$category = gd_lang_object_ids( $category, $category_taxonomy[0] );
3704
		}
3705
		######### WPML #########
3706
3707
		$tax_query = array(
3708
			'taxonomy' => $category_taxonomy[0],
3709
			'field'    => 'id',
3710
			'terms'    => $category
3711
		);
3712
3713
		$query_args['tax_query'] = array( $tax_query );
3714
	}
3715
3716
	global $gridview_columns_widget, $geodir_is_widget_listing;
3717