Code Duplication    Length = 19-19 lines in 2 locations

classes/fields/pick.php 2 locations

@@ 1674-1692 (lines=19) @@
1671
                            elseif ( 'taxonomy' == $object_type && $sitepress->is_translated_taxonomy( $object ) )
1672
                                $translated = true;
1673
1674
                            if ( $translated ) {
1675
                                $object_id = icl_object_id( $result[ $search_data->field_id ], $object, false, $current_language );
1676
1677
                                if ( 0 < $object_id && !in_array( $object_id, $ids ) ) {
1678
                                    $text = $result[ $search_data->field_index ];
1679
1680
                                    if ( $result[ $search_data->field_id ] != $object_id ) {
1681
                                        if ( $wpdb->posts == $search_data->table )
1682
                                            $text = trim( get_the_title( $object_id ) );
1683
                                        elseif ( $wpdb->terms == $search_data->table )
1684
                                            $text = trim( get_term( $object_id, $object )->name );
1685
                                    }
1686
1687
                                    $result[ $search_data->field_id ] = $object_id;
1688
                                    $result[ $search_data->field_index ] = $text;
1689
                                }
1690
                                else
1691
                                    continue;
1692
                            }
1693
                        }
1694
                        // Polylang integration for Post Types and Taxonomies
1695
                        elseif ( is_object( $polylang ) && in_array( $object_type, array( 'post_type', 'taxonomy' ) ) && method_exists( $polylang, 'get_translation' ) ) {
@@ 1703-1721 (lines=19) @@
1700
                            elseif ( 'taxonomy' == $object_type && pll_is_translated_taxonomy( $object ) )
1701
                                $translated = true;
1702
1703
                            if ( $translated ) {
1704
                                $object_id = $polylang->get_translation( $object, $result[ $search_data->field_id ], $current_language );
1705
1706
                                if ( 0 < $object_id && !in_array( $object_id, $ids ) ) {
1707
                                    $text = $result[ $search_data->field_index ];
1708
1709
                                    if ( $result[ $search_data->field_id ] != $object_id ) {
1710
                                        if ( $wpdb->posts == $search_data->table )
1711
                                            $text = trim( get_the_title( $object_id ) );
1712
                                        elseif ( $wpdb->terms == $search_data->table )
1713
                                            $text = trim( get_term( $object_id, $object )->name );
1714
                                    }
1715
1716
                                    $result[ $search_data->field_id ] = $object_id;
1717
                                    $result[ $search_data->field_index ] = $text;
1718
                                }
1719
                                else
1720
                                    continue;
1721
                            }
1722
                        }
1723
1724
                        if ( 0 < strlen( $display_filter ) ) {