$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(); ?>

__( 'WooCommerce Email Designer', 'yaymail' ), 'type' => 'title', 'id' => 'yaymail_email_designer', ], [ 'title' => __( 'Customize WooCommerce Emails', 'yaymail' ), 'desc' => '', 'id' => 'woocommerce_customizer_emails', 'type' => 'yaymail_button', 'desc_tip' => true, ], [ 'type' => 'sectionend', 'id' => 'yaymail_email_designer', ], ]; // Add custom button HTML add_action( 'woocommerce_admin_field_yaymail_button', [ $this, 'output_button' ] ); $settings = array_merge( $settings, $yaymail_settings ); return $settings; } /** * Output the custom button HTML * * @param array $value Button field settings. */ public function output_button( $value ) { ?>

.