Code Duplication    Length = 2-2 lines in 4 locations

classes/PodsAPI.php 4 locations

@@ 7844-7845 (lines=2) @@
7841
                            if ( in_array( $type, PodsForm::file_field_types() ) || 'media' == $pick_object ) {
7842
                                $where = "`guid` = '" . pods_sanitize( $pick_value ) . "'";
7843
7844
                                if ( 0 < pods_absint( $pick_value ) && false !== $numeric_mode )
7845
                                    $where = "`ID` = " . pods_absint( $pick_value );
7846
7847
                                $result = pods_query( "SELECT `ID` AS `id` FROM `{$wpdb->posts}` WHERE `post_type` = 'attachment' AND {$where} ORDER BY `ID`", $this );
7848
@@ 7869-7870 (lines=2) @@
7866
                                if ( in_array( 'taxonomy', array( $pick_object, $related_pod[ 'type' ] ) ) ) {
7867
                                    $where = "`t`.`name` = '" . pods_sanitize( $pick_value ) . "'";
7868
7869
                                    if ( 0 < pods_absint( $pick_value ) && false !== $numeric_mode )
7870
                                        $where = "`tt`.`term_id` = " . pods_absint( $pick_value );
7871
7872
                                    $result = pods_query( "SELECT `t`.`term_id` AS `id` FROM `{$wpdb->term_taxonomy}` AS `tt` LEFT JOIN `{$wpdb->terms}` AS `t` ON `t`.`term_id` = `tt`.`term_id` WHERE `taxonomy` = '{$pick_val}' AND {$where} ORDER BY `t`.`term_id`", $this );
7873
@@ 7880-7881 (lines=2) @@
7877
                                elseif ( in_array( 'post_type', array( $pick_object, $related_pod[ 'type' ] ) ) || in_array( 'media', array( $pick_object, $related_pod[ 'type' ] ) ) ) {
7878
                                    $where = "`post_title` = '" . pods_sanitize( $pick_value ) . "'";
7879
7880
                                    if ( 0 < pods_absint( $pick_value ) && false !== $numeric_mode )
7881
                                        $where = "`ID` = " . pods_absint( $pick_value );
7882
7883
                                    $result = pods_query( "SELECT `ID` AS `id` FROM `{$wpdb->posts}` WHERE `post_type` = '{$pick_val}' AND {$where} ORDER BY `ID`", $this );
7884
@@ 7891-7892 (lines=2) @@
7888
                                elseif ( in_array( 'user', array( $pick_object, $related_pod[ 'type' ] ) ) ) {
7889
                                    $where = "`user_login` = '" . pods_sanitize( $pick_value ) . "'";
7890
7891
                                    if ( 0 < pods_absint( $pick_value ) && false !== $numeric_mode )
7892
                                        $where = "`ID` = " . pods_absint( $pick_value );
7893
7894
                                    $result = pods_query( "SELECT `ID` AS `id` FROM `{$wpdb->users}` WHERE {$where} ORDER BY `ID`", $this );
7895