PluginProbe
YayMail – WooCommerce Email Customizer / 4.3.2
YayMail – WooCommerce Email Customizer v4.3.2
4.4.4 4.4.3 4.4.2 4.4.1 trunk 1.9.6 2.1.4 2.1.5 3.2.2 3.2.6 3.2.7.1 3.2.8.1 3.2.9 3.3 3.3.1 3.3.4 3.3.5 3.3.6 3.3.7 3.3.8 3.3.9 3.4 3.4.1 3.4.2 3.4.3 All 55 releases
← All changes | src/Controllers/TemplateController.php +5 -15 trunk4.3.2 View file →
@@ -201,9 +201,8 @@
201 201 $text_link_color = sanitize_text_field( $data['text_link_color'] );
202 202 $content_background_color = sanitize_text_field( $data['content_background_color'] );
203 203 $content_text_color = sanitize_text_field( $data['content_text_color'] );
204 204 $title_color = sanitize_text_field( $data['title_color'] );
205 - $preheader = sanitize_text_field( $data['preheader'] );
206 205 $global_header_settings = $data['global_header_settings'] ?? YayMailTemplate::DEFAULT_DATA['global_header_settings'];
207 206 $global_footer_settings = $data['global_footer_settings'] ?? YayMailTemplate::DEFAULT_DATA['global_footer_settings'];
208 207 $update_data = [
209 208 'elements' => $elements,
@@ -213,17 +212,11 @@
213 212 'content_text_color' => $content_text_color,
214 213 'title_color' => $title_color,
215 214 'global_header_settings' => $global_header_settings,
216 215 'global_footer_settings' => $global_footer_settings,
217 - 'preheader' => $preheader,
218 216 ];
219 -
220 - if ( isset( $data['email_subject'] ) ) {
221 - $template_name = get_post_meta( (int) $id, YayMailTemplate::META_KEYS['name'], true );
222 - $this->model::save_email_subject( $template_name, $data['email_subject'] );
223 - }
224 -
225 - return $this->model::update( $id, $update_data, true );
217 + $updated_data = $this->model::update( $id, $update_data, true );
218 + return $updated_data;
226 219 }
227 220
228 221 public function exec_delete_template( \WP_REST_Request $request ) {
229 222 return $this->exec( [ $this, 'delete_template' ], $request );
@@ -393,11 +386,8 @@
393 386 return $this->exec( [ $this, 'change_global_header_footer_status' ], $request );
394 387 }
395 388
396 389 public function change_global_header_footer_status( \WP_REST_Request $request ) {
397 - $status = filter_var( $request->get_param( 'status' ), FILTER_VALIDATE_BOOLEAN );
398 - $platform = sanitize_text_field( $request->get_param( 'platform' ) ?? 'yaymail' );
399 - $platform_obj = \YayMail\Platform\PlatformRegistry::get( $platform ) ?? \YayMail\Platform\PlatformRegistry::get( 'yaymail' );
400 - $key = $platform_obj ? $platform_obj->ghf_option_key( 'enabled' ) : 'global_header_footer_enabled';
401 - return SettingModel::update( [ $key => $status ] );
390 + $status = sanitize_text_field( $request->get_param( 'status' ) );
391 + return SettingModel::update( [ 'global_header_footer_enabled' => $status ] );
402 392 }
403 -}
393 +}