Code Duplication    Length = 2-2 lines in 4 locations

classes/PodsAPI.php 4 locations

@@ 8048-8049 (lines=2) @@
8045
                            if ( in_array( $type, PodsForm::file_field_types() ) || 'media' == $pick_object ) {
8046
                                $where = "`guid` = '" . pods_sanitize( $pick_value ) . "'";
8047
8048
                                if ( 0 < pods_absint( $pick_value ) && false !== $numeric_mode )
8049
                                    $where = "`ID` = " . pods_absint( $pick_value );
8050
8051
                                $result = pods_query( "SELECT `ID` AS `id` FROM `{$wpdb->posts}` WHERE `post_type` = 'attachment' AND {$where} ORDER BY `ID`", $this );
8052
@@ 8073-8074 (lines=2) @@
8070
                                if ( in_array( 'taxonomy', array( $pick_object, $related_pod[ 'type' ] ) ) ) {
8071
                                    $where = "`t`.`name` = '" . pods_sanitize( $pick_value ) . "'";
8072
8073
                                    if ( 0 < pods_absint( $pick_value ) && false !== $numeric_mode )
8074
                                        $where = "`tt`.`term_id` = " . pods_absint( $pick_value );
8075
8076
                                    $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 );
8077
@@ 8084-8085 (lines=2) @@
8081
                                elseif ( in_array( 'post_type', array( $pick_object, $related_pod[ 'type' ] ) ) || in_array( 'media', array( $pick_object, $related_pod[ 'type' ] ) ) ) {
8082
                                    $where = "`post_title` = '" . pods_sanitize( $pick_value ) . "'";
8083
8084
                                    if ( 0 < pods_absint( $pick_value ) && false !== $numeric_mode )
8085
                                        $where = "`ID` = " . pods_absint( $pick_value );
8086
8087
                                    $result = pods_query( "SELECT `ID` AS `id` FROM `{$wpdb->posts}` WHERE `post_type` = '{$pick_val}' AND {$where} ORDER BY `ID`", $this );
8088
@@ 8095-8096 (lines=2) @@
8092
                                elseif ( in_array( 'user', array( $pick_object, $related_pod[ 'type' ] ) ) ) {
8093
                                    $where = "`user_login` = '" . pods_sanitize( $pick_value ) . "'";
8094
8095
                                    if ( 0 < pods_absint( $pick_value ) && false !== $numeric_mode )
8096
                                        $where = "`ID` = " . pods_absint( $pick_value );
8097
8098
                                    $result = pods_query( "SELECT `ID` AS `id` FROM `{$wpdb->users}` WHERE {$where} ORDER BY `ID`", $this );
8099