Code Duplication    Length = 9-9 lines in 2 locations

classes/PodsAPI.php 2 locations

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