PluginProbe
CartFlows – Funnel Builder & Checkout Plugin for WooCommerce / 3.3.0
CartFlows – Funnel Builder & Checkout Plugin for WooCommerce v3.3.0
3.3.0 3.2.1 3.2.0 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.1 trunk 1.0.4 1.1.0 1.1.0.1 1.1.1 1.1.10 1.1.11 1.1.12 1.1.13 1.1.14 1.1.15 1.1.16 1.1.17 1.1.18 1.1.19 1.1.2 All 162 releases
← All changes | admin-core/ajax/flows.php +11 -2 3.2.1 → 3.3.0 View file →
@@ -141,8 +141,10 @@
141 141 'status' => false,
142 142 'text' => __( 'Can\'t update the flow data', 'cartflows' ),
143 143 );
144 144
145 + $skipped_fields = array();
146 +
145 147 if ( isset( $_POST['flow_id'] ) ) {
146 148 $flow_id = intval( $_POST['flow_id'] );
147 149
148 150 if ( empty( $flow_id ) ) {
@@ -160,10 +162,10 @@
160 162 }
161 163
162 164 $new_flow_slug = isset( $_POST['post_name'] ) ? sanitize_text_field( wp_unslash( $_POST['post_name'] ) ) : '';
163 165
164 - $post_meta = wcf()->options->get_flow_fields( $flow_id );
165 - MetaOps::save_meta_fields( $flow_id, $post_meta, 'cartflows_save_flow_meta_settings' );
166 + $post_meta = wcf()->options->get_flow_fields( $flow_id );
167 + $skipped_fields = MetaOps::save_meta_fields( $flow_id, $post_meta, 'cartflows_save_flow_meta_settings' );
166 168
167 169 $instant_layout_style = isset( $_POST['instant-layout-style'] ) ? sanitize_text_field( wp_unslash( $_POST['instant-layout-style'] ) ) : null;
168 170
169 171 if ( 'yes' === $instant_layout_style ) {
@@ -183,8 +185,15 @@
183 185
184 186 $response_data = array(
185 187 'message' => __( 'Successfully saved the flow data!', 'cartflows' ),
186 188 );
189 +
190 + // Name anything the save dropped rather than reporting a clean save the user did not get.
191 + if ( ! empty( $skipped_fields ) ) {
192 + $response_data['skipped_fields'] = $skipped_fields;
193 + $response_data['message'] = __( 'Saved, but the custom script fields were not updated because your account cannot edit scripts.', 'cartflows' );
194 + }
195 +
187 196 wp_send_json_success( $response_data );
188 197 }
189 198
190 199 /**