Code Duplication    Length = 9-9 lines in 2 locations

classes/PodsAPI.php 2 locations

@@ 7651-7659 (lines=9) @@
7648
			    $info[ 'where' ][ 'wpml_languages' ] = "`wpml_languages`.`code` IS NOT NULL";
7649
		    }
7650
		    // Polylang support
7651
		    elseif( ( function_exists( 'PLL' ) || is_object( $polylang ) ) && !empty( $current_language ) && function_exists( 'pll_is_translated_post_type' ) && pll_is_translated_post_type( $post_type ) ) {
7652
			    $info[ 'join' ][ 'polylang_languages' ] = "
7653
                        LEFT JOIN `{$wpdb->term_relationships}` AS `polylang_languages`
7654
                            ON `polylang_languages`.`object_id` = `t`.`ID`
7655
                                AND `polylang_languages`.`term_taxonomy_id` = {$current_language_tt_id}
7656
                    ";
7657
7658
			    $info[ 'where' ][ 'polylang_languages' ] = "`polylang_languages`.`object_id` IS NOT NULL";
7659
		    }
7660
7661
		    $info[ 'object_fields' ] = $this->get_wp_object_fields( $object_type, $info[ 'pod' ] );
7662
	    }
@@ 7733-7741 (lines=9) @@
7730
			    $info[ 'where' ][ 'wpml_languages' ] = "`wpml_languages`.`code` IS NOT NULL";
7731
		    }
7732
		    // Polylang support
7733
		    elseif ( ( function_exists( 'PLL' ) || is_object( $polylang ) ) && !empty( $current_language ) && !empty( $current_language_tl_tt_id ) && function_exists( 'pll_is_translated_taxonomy' ) && pll_is_translated_taxonomy( $taxonomy ) ) {
7734
				$info[ 'join' ][ 'polylang_languages' ] = "
7735
					LEFT JOIN `{$wpdb->term_relationships}` AS `polylang_languages`
7736
						ON `polylang_languages`.`object_id` = `t`.`term_id`
7737
							AND `polylang_languages`.`term_taxonomy_id` = {$current_language_tl_tt_id}
7738
				";
7739
7740
			    $info[ 'where' ][ 'polylang_languages' ] = "`polylang_languages`.`object_id` IS NOT NULL";
7741
		    }
7742
7743
		    $info[ 'object_fields' ] = $this->get_wp_object_fields( $object_type, $info[ 'pod' ] );
7744
	    }