PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 2.6.5
ShopBuilder – WooCommerce Builder For Elementor v2.6.5
3.4.2 3.4.1 3.4.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 All 63 releases
← All changes | app/Helpers/Migration.php +30 -8 2.1.112.6.5 View file →
@@ -32,15 +32,15 @@
32 32 ExtraSettings::instance()->set_option( 'settings_migration_v_2_0_4', RTSB_VERSION );
33 33 return;
34 34 }
35 35
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;
36 + $v_2_1_16 = ExtraSettings::instance()->get_option( 'template_settings_migration_v_2_1_16', false );
37 + if ( ! $v_2_1_16 ) {
38 + self::template_settings_migration_plugin_v_2_1_16();
39 + ExtraSettings::instance()->set_option( 'template_settings_migration_v_2_1_16', RTSB_VERSION );
40 + return;
41 + }
42 + // return;
43 43 }
44 44 /**
45 45 * @return void
46 46 */
@@ -59,9 +59,9 @@
59 59 * @return void
60 60 */
61 61 public static function settings_migration_plugin_v_2_0_4() {
62 62 global $wpdb;
63 - // Prefixes to search for
63 + // Prefixes to search for.
64 64 $prefixes = [
65 65 'rtsb_tb_template',
66 66 'rtsb_template_specific',
67 67 'rtsb_template_for',
@@ -104,8 +104,30 @@
104 104 if ( ! empty( $value ) ) {
105 105 ExtraSettings::instance()->set_option( $option->option_name, $value );
106 106 }
107 107 delete_option( $option->option_name );
108 + }
109 + }
110 + }
111 + }
112 +
113 + /**
114 + * @return void
115 + */
116 + private static function template_settings_migration_plugin_v_2_1_16() {
117 + $args = [
118 + 'post_type' => BuilderFns::$post_type_tb,
119 + 'numberposts' => -1,
120 + 'fields' => 'ids',
121 + ];
122 + $posts_id = get_posts( $args );
123 + if ( ! empty( $posts_id ) ) {
124 + foreach ( $posts_id as $id ) {
125 + $template_type = BuilderFns::builder_type( $id );
126 + $options_name = BuilderFns::option_name_by_template_id( $id );
127 + $product_ids = TemplateSettings::instance()->get_option( $options_name );
128 + if ( 'product' === $template_type && ! empty( $product_ids ) ) {
129 + update_post_meta( $id, '_is_product_page_template_for', 'specific_products' );
108 130 }
109 131 }
110 132 }
111 133 }