Code Duplication    Length = 13-18 lines in 2 locations

sql/update-2.0-beta.php 2 locations

@@ 26-38 (lines=13) @@
23
}
24
25
// Update to 2.0.0-b-10
26
if ( version_compare( $pods_version, '2.0.0-b-10', '<' ) ) {
27
	$author_fields = $wpdb->get_results( "SELECT `ID` FROM `{$wpdb->posts}` WHERE `post_name` = 'author' AND `post_type` = '_pods_field'" );
28
29
	if ( ! empty( $author_fields ) ) {
30
		foreach ( $author_fields as $author ) {
31
			update_post_meta( $author->ID, 'pick_format_type', 'single' );
32
			update_post_meta( $author->ID, 'pick_format_single', 'autocomplete' );
33
			update_post_meta( $author->ID, 'default_value', '{@user.ID}' );
34
		}
35
	}
36
37
	update_option( 'pods_framework_version', '2.0.0-b-10' );
38
}
39
40
// Update to 2.0.0-b-11
41
if ( version_compare( $pods_version, '2.0.0-b-11', '<' ) ) {
@@ 41-58 (lines=18) @@
38
}
39
40
// Update to 2.0.0-b-11
41
if ( version_compare( $pods_version, '2.0.0-b-11', '<' ) ) {
42
	$date_fields = $wpdb->get_results(
43
		"
44
            SELECT `ID`
45
            FROM `{$wpdb->posts}`
46
            WHERE ( `post_name` = 'created' OR `post_name` = 'modified' ) AND `post_type` = '_pods_field'
47
        "
48
	);
49
50
	if ( ! empty( $date_fields ) ) {
51
		foreach ( $date_fields as $date ) {
52
			update_post_meta( $date->ID, 'date_format_type', 'datetime' );
53
			update_post_meta( $date->ID, 'date_format', 'ymd_slash' );
54
			update_post_meta( $date->ID, 'date_time_type', '12' );
55
			update_post_meta( $date->ID, 'date_time_format', 'h_mm_ss_A' );
56
		}
57
	}
58
59
	update_option( 'pods_framework_version', '2.0.0-b-11' );
60
}
61