Code Duplication    Length = 9-9 lines in 2 locations

classes/PodsAPI.php 2 locations

@@ 7713-7721 (lines=9) @@
7710
			    $info[ 'where' ][ 'wpml_languages' ] = "`wpml_languages`.`code` IS NOT NULL";
7711
		    }
7712
		    // Polylang support
7713
		    elseif( ( function_exists( 'PLL' ) || is_object( $polylang ) ) && !empty( $current_language ) && function_exists( 'pll_is_translated_post_type' ) && pll_is_translated_post_type( $post_type ) ) {
7714
			    $info[ 'join' ][ 'polylang_languages' ] = "
7715
                        LEFT JOIN `{$wpdb->term_relationships}` AS `polylang_languages`
7716
                            ON `polylang_languages`.`object_id` = `t`.`ID`
7717
                                AND `polylang_languages`.`term_taxonomy_id` = {$current_language_tt_id}
7718
                    ";
7719
7720
			    $info[ 'where' ][ 'polylang_languages' ] = "`polylang_languages`.`object_id` IS NOT NULL";
7721
		    }
7722
7723
		    $info[ 'object_fields' ] = $this->get_wp_object_fields( $object_type, $info[ 'pod' ] );
7724
	    }
@@ 7795-7803 (lines=9) @@
7792
			    $info[ 'where' ][ 'wpml_languages' ] = "`wpml_languages`.`code` IS NOT NULL";
7793
		    }
7794
		    // Polylang support
7795
		    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 ) ) {
7796
				$info[ 'join' ][ 'polylang_languages' ] = "
7797
					LEFT JOIN `{$wpdb->term_relationships}` AS `polylang_languages`
7798
						ON `polylang_languages`.`object_id` = `t`.`term_id`
7799
							AND `polylang_languages`.`term_taxonomy_id` = {$current_language_tl_tt_id}
7800
				";
7801
7802
			    $info[ 'where' ][ 'polylang_languages' ] = "`polylang_languages`.`object_id` IS NOT NULL";
7803
		    }
7804
7805
		    $info[ 'object_fields' ] = $this->get_wp_object_fields( $object_type, $info[ 'pod' ] );
7806
	    }