| @@ -32,16 +32,15 @@ | ||
| 32 | 32 | ExtraSettings::instance()->set_option( 'settings_migration_v_2_0_4', RTSB_VERSION ); |
| 33 | 33 | return; |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - $v_2_1_16 = ExtraSettings::instance()->get_option( 'template_settings_migration_v_2_1_16', false ); | |
| 37 | - if ( ! $v_2_1_16 ) { | |
| 38 | - // error_log( print_r( $v_2_1_16 , true) . "\n\n", 3, __DIR__ . '/log.txt' ); | |
| 39 | - self::template_settings_migration_plugin_v_2_1_16(); | |
| 40 | - ExtraSettings::instance()->set_option( 'template_settings_migration_v_2_1_16', RTSB_VERSION ); | |
| 41 | - return; | |
| 42 | - } | |
| 43 | - // return; | |
| 36 | + /* | |
| 37 | + * Example Migration | |
| 38 | + else if ( ! AdditionalSettings::instance()->get_option( 'template_settings_migration_v_2_0_4' ) ) { | |
| 39 | + } else if ( ! AdditionalSettings::instance()->get_option( 'template_settings_migration_v_2_0_5' ) ) { | |
| 40 | + } | |
| 41 | + */ | |
| 42 | + return; | |
| 44 | 43 | } |
| 45 | 44 | /** |
| 46 | 45 | * @return void |
| 47 | 46 | */ |
| @@ -60,9 +59,9 @@ | ||
| 60 | 59 | * @return void |
| 61 | 60 | */ |
| 62 | 61 | public static function settings_migration_plugin_v_2_0_4() { |
| 63 | 62 | global $wpdb; |
| 64 | - // Prefixes to search for. | |
| 63 | + // Prefixes to search for | |
| 65 | 64 | $prefixes = [ |
| 66 | 65 | 'rtsb_tb_template', |
| 67 | 66 | 'rtsb_template_specific', |
| 68 | 67 | 'rtsb_template_for', |
| @@ -105,30 +104,8 @@ | ||
| 105 | 104 | if ( ! empty( $value ) ) { |
| 106 | 105 | ExtraSettings::instance()->set_option( $option->option_name, $value ); |
| 107 | 106 | } |
| 108 | 107 | delete_option( $option->option_name ); |
| 109 | - } | |
| 110 | - } | |
| 111 | - } | |
| 112 | - } | |
| 113 | - | |
| 114 | - /** | |
| 115 | - * @return void | |
| 116 | - */ | |
| 117 | - private static function template_settings_migration_plugin_v_2_1_16() { | |
| 118 | - $args = [ | |
| 119 | - 'post_type' => BuilderFns::$post_type_tb, | |
| 120 | - 'numberposts' => -1, | |
| 121 | - 'fields' => 'ids', | |
| 122 | - ]; | |
| 123 | - $posts_id = get_posts( $args ); | |
| 124 | - if ( ! empty( $posts_id ) ) { | |
| 125 | - foreach ( $posts_id as $id ) { | |
| 126 | - $template_type = BuilderFns::builder_type( $id ); | |
| 127 | - $options_name = BuilderFns::option_name_by_template_id( $id ); | |
| 128 | - $product_ids = TemplateSettings::instance()->get_option( $options_name ); | |
| 129 | - if ( 'product' === $template_type && ! empty( $product_ids ) ) { | |
| 130 | - update_post_meta( $id, '_is_product_page_template_for', 'specific_products' ); | |
| 131 | 108 | } |
| 132 | 109 | } |
| 133 | 110 | } |
| 134 | 111 | } |