Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Alter the output of a specific WooCommerce My Account column, in this case replacing the date format used for displaying the order date.
<?php
/**
* Alter the date order output (in this case, the format of the displayed date).
*
* @param object $order
*/
add_action( 'woocommerce_my_account_my_orders_column_order-date', 'alter_order_date_format', 10, 1 );
function alter_order_date_format( $order ) {
echo '<time datetime="' . date( 'Y-m-d', strtotime( $order->order_date ) ) . '" title="' . esc_attr( strtotime( $order->order_date ) ) . '">' . date_i18n( 'm/d/Y', strtotime( $order->order_date ) ) . '</time>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.