Code Duplication    Length = 2-2 lines in 4 locations

classes/PodsAPI.php 4 locations

@@ 8052-8053 (lines=2) @@
8049
                            if ( in_array( $type, PodsForm::file_field_types() ) || 'media' == $pick_object ) {
8050
                                $where = "`guid` = '" . pods_sanitize( $pick_value ) . "'";
8051
8052
                                if ( 0 < pods_absint( $pick_value ) && false !== $numeric_mode )
8053
                                    $where = "`ID` = " . pods_absint( $pick_value );
8054
8055
                                $result = pods_query( "SELECT `ID` AS `id` FROM `{$wpdb->posts}` WHERE `post_type` = 'attachment' AND {$where} ORDER BY `ID`", $this );
8056
@@ 8077-8078 (lines=2) @@
8074
                                if ( in_array( 'taxonomy', array( $pick_object, $related_pod[ 'type' ] ) ) ) {
8075
                                    $where = "`t`.`name` = '" . pods_sanitize( $pick_value ) . "'";
8076
8077
                                    if ( 0 < pods_absint( $pick_value ) && false !== $numeric_mode )
8078
                                        $where = "`tt`.`term_id` = " . pods_absint( $pick_value );
8079
8080
                                    $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 );
8081
@@ 8088-8089 (lines=2) @@
8085
                                elseif ( in_array( 'post_type', array( $pick_object, $related_pod[ 'type' ] ) ) || in_array( 'media', array( $pick_object, $related_pod[ 'type' ] ) ) ) {
8086
                                    $where = "`post_title` = '" . pods_sanitize( $pick_value ) . "'";
8087
8088
                                    if ( 0 < pods_absint( $pick_value ) && false !== $numeric_mode )
8089
                                        $where = "`ID` = " . pods_absint( $pick_value );
8090
8091
                                    $result = pods_query( "SELECT `ID` AS `id` FROM `{$wpdb->posts}` WHERE `post_type` = '{$pick_val}' AND {$where} ORDER BY `ID`", $this );
8092
@@ 8099-8100 (lines=2) @@
8096
                                elseif ( in_array( 'user', array( $pick_object, $related_pod[ 'type' ] ) ) ) {
8097
                                    $where = "`user_login` = '" . pods_sanitize( $pick_value ) . "'";
8098
8099
                                    if ( 0 < pods_absint( $pick_value ) && false !== $numeric_mode )
8100
                                        $where = "`ID` = " . pods_absint( $pick_value );
8101
8102
                                    $result = pods_query( "SELECT `ID` AS `id` FROM `{$wpdb->users}` WHERE {$where} ORDER BY `ID`", $this );
8103