Code Duplication    Length = 9-9 lines in 2 locations

classes/PodsAPI.php 2 locations

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