PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 3.2.6
ShopBuilder – WooCommerce Builder For Elementor v3.2.6
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/Controllers/Admin/Ajax/CreateTemplate.php +4 -30 3.4.23.2.6 View file →
@@ -63,21 +63,8 @@
63 63 ];
64 64 wp_send_json( $return );
65 65 }
66 66
67 - // Nonce verified above.
68 - $can_save = apply_filters( 'rtsb/builder/create_template/can_save', true, $page_type, $_POST ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
69 -
70 - if ( true !== $can_save ) {
71 - wp_send_json(
72 - [
73 - 'success' => false,
74 - 'post_id' => $page_id,
75 - 'message' => is_string( $can_save ) ? $can_save : esc_html__( 'Template cannot be saved.', 'shopbuilder' ),
76 - ]
77 - );
78 - }
79 -
80 67 add_filter(
81 68 'pre_option_elementor_unfiltered_files_upload',
82 69 function () {
83 70 return '1';
@@ -127,14 +114,9 @@
127 114 update_post_meta( $page_id, BuilderFns::$product_template_meta, $product_id );
128 115 update_post_meta( $page_id, '_is_product_page_template_for', $template_for );
129 116 }
130 117
131 - $has_default = TemplateSettings::instance()->get_option( $option_name );
132 - $singleton_types = apply_filters(
133 - 'rtsb/builder/singleton_types',
134 - array_keys( BuilderFns::builder_page_types() )
135 - );
136 - $is_pool_type = ! in_array( $page_type, $singleton_types, true );
118 + $has_default = TemplateSettings::instance()->get_option( $option_name );
137 119 if ( ( 'product' === $page_type && 'all_products' !== $template_for ) || ( 'archive' === $page_type && count( $selected_category ) ) ) {
138 120 if ( ! $has_default ) {
139 121 TemplateSettings::instance()->set_option( $option_name, '' );
140 122 }
@@ -139,20 +121,12 @@
139 121 TemplateSettings::instance()->set_option( $option_name, '' );
140 122 }
141 123 } else {
142 124 if ( 'default_template' === $default_template ) {
143 - if ( $is_pool_type ) {
144 - update_post_meta( $page_id, '_rtsb_tb_enabled_in_pool', 'on' );
145 - } else {
146 - TemplateSettings::instance()->set_option( $option_name, $page_id );
147 - }
125 + TemplateSettings::instance()->set_option( $option_name, $page_id );
148 126 } else {
149 - if ( $is_pool_type ) {
150 - delete_post_meta( $page_id, '_rtsb_tb_enabled_in_pool' );
151 - } else {
152 - if ( ! $has_default ) {
153 - TemplateSettings::instance()->set_option( $option_name, '' );
154 - }
127 + if ( ! $has_default ) {
128 + TemplateSettings::instance()->set_option( $option_name, '' );
155 129 }
156 130 }
157 131 }
158 132