Code Duplication    Length = 9-9 lines in 2 locations

classes/PodsAPI.php 2 locations

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