Filter uncanny-automator

automator_woocommerce_order_summary_td_text_color

Filters the text color for order summary table data cells within WooCommerce to customize its appearance.

add_filter( 'automator_woocommerce_order_summary_td_text_color', $callback, 10, 1 );

Description

Filters the text color used in WooCommerce order summaries within Uncanny Automator. Developers can modify the default hex code to customize the appearance of order summary text, influencing how details are displayed in automations. The $order object provides context for specific order modifications.


Usage

add_filter( 'automator_woocommerce_order_summary_td_text_color', 'your_function_name', 10, 1 );

Parameters

$order (mixed)
This parameter provides the default text color for the order summary in WooCommerce, which is a hex code representing a shade of gray.

Return Value

The filtered value.


Examples

<?php
/**
 * Change the default text color for table data cells in the WooCommerce order summary.
 *
 * This function modifies the default text color of the `<td>` elements within
 * the Uncanny Automator WooCommerce order summary to a slightly darker shade of gray.
 *
 * @param string $color The current text color for the `<td>` elements.
 * @param WC_Order $order The WooCommerce order object.
 * @return string The modified text color.
 */
add_filter( 'automator_woocommerce_order_summary_td_text_color', function( $color, $order ) {
    // Let's make the text slightly darker for better readability on some backgrounds
    return '#555555';
}, 10, 2 );

Placement

This code should be placed in the functions.php file of your active theme, a custom plugin, or using a code snippets plugin.


Source Code

src/integrations/woocommerce/tokens/wc-tokens.php:1004
src/integrations/wholesale-suite/tokens/wss-tokens.php:645
uncanny-automator-pro/src/integrations/woocommerce/tokens/wc-pro-tokens.php:2931

$font_colour      = apply_filters( 'automator_woocommerce_order_summary_text_color', '#000', $order );
		$font_family      = apply_filters( 'automator_woocommerce_order_summary_font_family', "'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif", $order );
		$table_styles     = apply_filters( 'automator_woocommerce_order_summary_table_style', '', $order );
		$border_colour    = apply_filters( 'automator_woocommerce_order_summary_border_color', '#eee', $order );
		$tr_border_colour = apply_filters( 'automator_woocommerce_order_summary_tr_border_color', '#e5e5e5', $order );
		$tr_text_colour   = apply_filters( 'automator_woocommerce_order_summary_tr_text_color', '#636363', $order );
		$td_border_colour = apply_filters( 'automator_woocommerce_order_summary_td_border_color', '#e5e5e5', $order );
		$td_text_colour   = apply_filters( 'automator_woocommerce_order_summary_td_text_color', '#636363', $order );
		
		// Add filters for container styling
		$max_width        = apply_filters( 'automator_woocommerce_order_summary_max_width', '640px', $order );
		$container_class  = apply_filters( 'automator_woocommerce_order_summary_container_class', 'automator-order-summary-container', $order );
		$container_id     = apply_filters( 'automator_woocommerce_order_summary_container_id', 'automator-order-summary-' . $order->get_id(), $order );
		$table_class      = apply_filters( 'automator_woocommerce_order_summary_table_class', 'automator-order-summary-table', $order );


Scroll to Top