WC_Settings_Emails::enable_email_improvements_when_trying_new_templates
When the email settings are saved, if the user is trying out the new email templates, enable the email improvements feature.
Method of the class: WC_Settings_Emails{}
No Hooks.
Returns
null. Nothing (null).
Usage
$WC_Settings_Emails = new WC_Settings_Emails(); $WC_Settings_Emails->enable_email_improvements_when_trying_new_templates();
WC_Settings_Emails::enable_email_improvements_when_trying_new_templates() WC Settings Emails::enable email improvements when trying new templates code WC 10.3.3
public function enable_email_improvements_when_trying_new_templates() {
if ( $this->is_trying_new_templates() ) {
$feature_controller = wc_get_container()->get( FeaturesController::class );
$feature_controller->change_feature_enable( 'email_improvements', true );
// Remove the try-new-templates parameter from the URL.
wp_safe_redirect( remove_query_arg( 'try-new-templates' ) );
exit;
}
}