PluginProbe ʕ •ᴥ•ʔ
Pods – Custom Content Types and Fields / trunk
Pods – Custom Content Types and Fields vtrunk
trunk 1.14.8 2.7.31.3 2.8.23.3 2.9.19.3 3.0.10.3 3.1.4.1 3.2.0 3.2.1 3.2.1.1 3.2.2 3.2.4 3.2.5 3.2.6 3.2.7 3.2.7.1 3.2.8 3.2.8.1 3.2.8.2 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.3.8 3.3.9
pods / sql / update.php
pods / sql Last commit date
upgrade 4 months ago dump.sql 4 years ago update-1.x.php 4 months ago update-2.0-beta.php 4 months ago update.php 4 months ago
update.php
96 lines
1 <?php
2
3 // Don't load directly.
4 if ( ! defined( 'ABSPATH' ) ) {
5 die( '-1' );
6 }
7
8 // phpcs:ignoreFile WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
9
10 /**
11 * @package Pods\Upgrade
12 */
13
14 // Update to 2.0.3
15 if ( version_compare( $pods_version, '2.0.3', '<' ) ) {
16 // Rename sister_field_id to sister_id
17 pods_query( "DELETE FROM `@wp_postmeta` WHERE `meta_key` = 'sister_field_id'", false );
18
19 update_option( 'pods_framework_version', '2.0.3' );
20 }
21
22 // Update to 2.3
23 if ( version_compare( $pods_version, '2.3', '<' ) ) {
24 // Auto activate Advanced Content Types component
25 $oldget = $_GET;
26
27 $_GET['toggle'] = 1;
28
29 PodsInit::$components->toggle( 'advanced-content-types' );
30 PodsInit::$components->toggle( 'table-storage' );
31
32 $_GET = $oldget;
33
34 update_option( 'pods_framework_version', '2.3' );
35 }
36
37 // Update to 2.3.4
38 if ( version_compare( $pods_version, '2.3.4', '<' ) ) {
39 if ( function_exists( 'pods_page_flush_rewrites' ) ) {
40 pods_page_flush_rewrites();
41 }
42
43 update_option( 'pods_framework_version', '2.3.4' );
44 }
45
46 // Update to 2.3.5
47 if ( version_compare( $pods_version, '2.3.5', '<' ) ) {
48 global $wpdb;
49
50 $wpdb->query( "UPDATE `{$wpdb->postmeta}` SET `meta_value` = 'dMy' WHERE `meta_key` IN ( 'date_format', 'datetime_format' ) AND `meta_value` = 'dMd'" );
51 $wpdb->query( "UPDATE `{$wpdb->postmeta}` SET `meta_value` = 'dMy_dash' WHERE `meta_key` IN ( 'date_format', 'datetime_format' ) AND `meta_value` = 'dMd_dash'" );
52
53 $pods_object_ids = $wpdb->get_col( "SELECT `ID` FROM `{$wpdb->posts}` WHERE `post_type` IN ( '_pods_pod', '_pods_field', '_pods_page', '_pods_template', '_pods_helper' )" );
54
55 if ( ! empty( $pods_object_ids ) ) {
56 array_walk( $pods_object_ids, 'absint' );
57
58 $wpdb->query(
59 $wpdb->prepare(
60 "DELETE FROM `{$wpdb->postmeta}` WHERE `post_id` IN ( " . implode( ', ', array_fill( 0, count( $pods_object_ids ), '%d' ) ) . " ) AND `meta_value` = ''",
61 $pods_object_ids
62 )
63 );
64 }
65
66 update_option( 'pods_framework_version', '2.3.5' );
67 }
68
69 // Update to 2.3.9
70 if ( version_compare( $pods_version, '2.3.9-a-1', '<' ) ) {
71 // Set autoload on all necessary options to avoid extra queries
72 $autoload_options = array(
73 'pods_framework_version' => '',
74 'pods_framework_version_last' => '',
75 'pods_framework_db_version' => '',
76 'pods_framework_upgraded_1_x' => '0',
77 'pods_version' => '',
78 'pods_component_settings' => '',
79 'pods_disable_file_browser' => '0',
80 'pods_files_require_login' => '1',
81 'pods_files_require_login_cap' => '',
82 'pods_disable_file_upload' => '0',
83 'pods_upload_require_login' => '1',
84 'pods_upload_require_login_cap' => '',
85 );
86
87 foreach ( $autoload_options as $option_name => $default ) {
88 $option_value = get_option( $option_name, $default );
89
90 delete_option( $option_name );
91 add_option( $option_name, $option_value, '', 'yes' );
92 }
93
94 update_option( 'pods_framework_version', '2.3.9-a-1' );
95 }//end if
96