WC_Settings_Emails::email_color_palette
Creates the React mount point for the email color palette title.
Method of the class: WC_Settings_Emails{}
No Hooks.
Returns
null. Nothing (null).
Usage
$WC_Settings_Emails = new WC_Settings_Emails(); $WC_Settings_Emails->email_color_palette( $value );
- $value(array) (required)
- Field value array.
WC_Settings_Emails::email_color_palette() WC Settings Emails::email color palette code WC 10.5.0
<?php
public function email_color_palette( $value ) {
$email_improvements_enabled = $this->get_email_improvements_enabled();
$default_colors = EmailColors::get_default_colors( $email_improvements_enabled );
$auto_sync = get_option( EmailStyleSync::AUTO_SYNC_OPTION, 'no' );
?>
<hr class="wc-settings-email-color-palette-separator" />
<div class="wc-settings-email-color-palette-header">
<h2 class="wc-settings-email-color-palette-title"><?php echo esc_html( $value['title'] ); ?></h2>
<?php if ( $email_improvements_enabled ) : ?>
<div
class="wc-settings-email-color-palette-buttons"
id="wc_settings_email_color_palette_slotfill"
data-default-colors="<?php echo esc_attr( wp_json_encode( $default_colors ) ); ?>"
<?php echo wp_theme_has_theme_json() ? 'data-has-theme-json' : ''; ?>
></div>
<input
type="hidden"
name="woocommerce_email_auto_sync_with_theme"
id="woocommerce_email_auto_sync_with_theme"
value="<?php echo esc_attr( $auto_sync ); ?>"
/>
<?php else : ?>
<div class="wc-settings-email-color-palette-buttons">
<button disabled type="button" class="components-button is-secondary"><?php esc_html_e( 'Sync with theme', 'woocommerce' ); ?></button>
</div>
<?php endif; ?>
</div>
<table class="form-table">
<?php
}