[WIP][Accessibility] Add field for the email footer text color (#49648)
Co-authored-by: amesplant <95257231+amesplant-dmv@users.noreply.github.com> Co-authored-by: Niels Lange <info@nielslange.de> Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
parent
67ab34aab2
commit
dbc3056845
|
@ -0,0 +1,4 @@
|
||||||
|
Significance: minor
|
||||||
|
Type: add
|
||||||
|
|
||||||
|
Add field for the email footer text color
|
|
@ -0,0 +1,4 @@
|
||||||
|
Significance: minor
|
||||||
|
Type: add
|
||||||
|
|
||||||
|
Add an additional field for the email settings that sets the footer text color
|
|
@ -130,19 +130,6 @@ class WC_Settings_Emails extends WC_Settings_Page {
|
||||||
'desc_tip' => true,
|
'desc_tip' => true,
|
||||||
),
|
),
|
||||||
|
|
||||||
array(
|
|
||||||
'title' => __( 'Footer text', 'woocommerce' ),
|
|
||||||
/* translators: %s: Available placeholders for use */
|
|
||||||
'desc' => __( 'The text to appear in the footer of all WooCommerce emails.', 'woocommerce' ) . ' ' . sprintf( __( 'Available placeholders: %s', 'woocommerce' ), '{site_title} {site_url}' ),
|
|
||||||
'id' => 'woocommerce_email_footer_text',
|
|
||||||
'css' => 'width:400px; height: 75px;',
|
|
||||||
'placeholder' => __( 'N/A', 'woocommerce' ),
|
|
||||||
'type' => 'textarea',
|
|
||||||
'default' => '{site_title} — Built with {WooCommerce}',
|
|
||||||
'autoload' => false,
|
|
||||||
'desc_tip' => true,
|
|
||||||
),
|
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'title' => __( 'Base color', 'woocommerce' ),
|
'title' => __( 'Base color', 'woocommerce' ),
|
||||||
/* translators: %s: default color */
|
/* translators: %s: default color */
|
||||||
|
@ -191,6 +178,31 @@ class WC_Settings_Emails extends WC_Settings_Page {
|
||||||
'desc_tip' => true,
|
'desc_tip' => true,
|
||||||
),
|
),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'title' => __( 'Footer text', 'woocommerce' ),
|
||||||
|
/* translators: %s: Available placeholders for use */
|
||||||
|
'desc' => __( 'The text to appear in the footer of all WooCommerce emails.', 'woocommerce' ) . ' ' . sprintf( __( 'Available placeholders: %s', 'woocommerce' ), '{site_title} {site_url}' ),
|
||||||
|
'id' => 'woocommerce_email_footer_text',
|
||||||
|
'css' => 'width:400px; height: 75px;',
|
||||||
|
'placeholder' => __( 'N/A', 'woocommerce' ),
|
||||||
|
'type' => 'textarea',
|
||||||
|
'default' => '{site_title} — Built with {WooCommerce}',
|
||||||
|
'autoload' => false,
|
||||||
|
'desc_tip' => true,
|
||||||
|
),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'title' => __( 'Footer text color', 'woocommerce' ),
|
||||||
|
/* translators: %s: footer default color */
|
||||||
|
'desc' => sprintf( __( 'The footer text color. Default %s.', 'woocommerce' ), '<code>#3c3c3c</code>' ),
|
||||||
|
'id' => 'woocommerce_email_footer_text_color',
|
||||||
|
'type' => 'color',
|
||||||
|
'css' => 'width:6em;',
|
||||||
|
'default' => '#3c3c3c',
|
||||||
|
'autoload' => false,
|
||||||
|
'desc_tip' => true,
|
||||||
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'type' => 'sectionend',
|
'type' => 'sectionend',
|
||||||
'id' => 'email_template_options',
|
'id' => 'email_template_options',
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
*
|
*
|
||||||
* @see https://woocommerce.com/document/template-structure/
|
* @see https://woocommerce.com/document/template-structure/
|
||||||
* @package WooCommerce\Templates\Emails
|
* @package WooCommerce\Templates\Emails
|
||||||
* @version 8.6.0
|
* @version 9.3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ( ! defined( 'ABSPATH' ) ) {
|
if ( ! defined( 'ABSPATH' ) ) {
|
||||||
|
@ -20,11 +20,12 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load colors.
|
// Load colors.
|
||||||
$bg = get_option( 'woocommerce_email_background_color' );
|
$bg = get_option( 'woocommerce_email_background_color' );
|
||||||
$body = get_option( 'woocommerce_email_body_background_color' );
|
$body = get_option( 'woocommerce_email_body_background_color' );
|
||||||
$base = get_option( 'woocommerce_email_base_color' );
|
$base = get_option( 'woocommerce_email_base_color' );
|
||||||
$base_text = wc_light_or_dark( $base, '#202020', '#ffffff' );
|
$base_text = wc_light_or_dark( $base, '#202020', '#ffffff' );
|
||||||
$text = get_option( 'woocommerce_email_text_color' );
|
$text = get_option( 'woocommerce_email_text_color' );
|
||||||
|
$footer_text = get_option( 'woocommerce_email_footer_text_color' );
|
||||||
|
|
||||||
// Pick a contrasting color for links.
|
// Pick a contrasting color for links.
|
||||||
$link_color = wc_hex_is_light( $base ) ? $base : $base_text;
|
$link_color = wc_hex_is_light( $base ) ? $base : $base_text;
|
||||||
|
@ -97,7 +98,7 @@ body {
|
||||||
|
|
||||||
#template_footer #credit {
|
#template_footer #credit {
|
||||||
border: 0;
|
border: 0;
|
||||||
color: <?php echo esc_attr( $text_lighter_40 ); ?>;
|
color: <?php echo esc_attr( $footer_text ); ?>;
|
||||||
font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
|
font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
line-height: 150%;
|
line-height: 150%;
|
||||||
|
@ -190,6 +191,11 @@ body {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#template_footer #credit,
|
||||||
|
#template_footer #credit a {
|
||||||
|
color: <?php echo esc_attr( $footer_text ); ?>;
|
||||||
|
}
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
color: <?php echo esc_attr( $base ); ?>;
|
color: <?php echo esc_attr( $base ); ?>;
|
||||||
font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
|
font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
|
||||||
|
|
|
@ -82,6 +82,7 @@ class WC_Settings_Emails_Test extends WC_Settings_Unit_Test_Case {
|
||||||
'woocommerce_email_background_color' => 'color',
|
'woocommerce_email_background_color' => 'color',
|
||||||
'woocommerce_email_body_background_color' => 'color',
|
'woocommerce_email_body_background_color' => 'color',
|
||||||
'woocommerce_email_text_color' => 'color',
|
'woocommerce_email_text_color' => 'color',
|
||||||
|
'woocommerce_email_footer_text_color' => 'color',
|
||||||
'email_merchant_notes' => array( 'title', 'sectionend' ),
|
'email_merchant_notes' => array( 'title', 'sectionend' ),
|
||||||
'woocommerce_merchant_email_notifications' => 'checkbox',
|
'woocommerce_merchant_email_notifications' => 'checkbox',
|
||||||
);
|
);
|
||||||
|
|
|
@ -2944,6 +2944,8 @@ importers:
|
||||||
specifier: ^3.0.15
|
specifier: ^3.0.15
|
||||||
version: 3.0.15
|
version: 3.0.15
|
||||||
|
|
||||||
|
plugins/tiktok-for-business: {}
|
||||||
|
|
||||||
plugins/woo-ai:
|
plugins/woo-ai:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@automattic/tour-kit':
|
'@automattic/tour-kit':
|
||||||
|
|
Loading…
Reference in New Issue