$setting ) {
if ( $setting['id'] === 'woocommerce_feature_block_email_editor_enabled' ) {
$introduction_text = sprintf( __( 'You can customize WooCommerce emails with YayMail - WooCommerce Email Customizer', 'yaymail' ), esc_url( admin_url( 'admin.php?page=yaymail-settings#' ), 'yaymail' ) );
$settings[ $index ]['desc'] .= '
' . $introduction_text . '
';
}
}
return $settings;
}
);
}
public function display_preview_notice( $email ) {
if ( ! ( isset( $_REQUEST['_wpnonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_REQUEST['_wpnonce'] ) ), 'preview-mail' ) ) ) {
return $email;
}
if ( isset( $_GET['preview_woocommerce_mail'] ) && ! Helpers::is_true( sanitize_text_field( wp_unslash( $_GET['preview_woocommerce_mail'] ) ) ) ) {
return $email;
}
if ( isset( $_GET['rest_route'] ) && $_GET['rest_route'] === '/wc-admin-email/settings/email/send-preview' ) {
return $email;
}
if ( ! isset( $email->id ) ) {
return $email;
}
$email_id = $email->id;
$yaymail_template = new YayMailTemplate( $email_id );
if ( ! $yaymail_template->is_exists() ) {
return $email;
}
if ( ! $yaymail_template->is_enabled() ) {
return $email;
}
add_filter( 'yaymail_previewing_template_is_yaymail_template', '__return_true' );
ob_start();
?>