Skip to content

Instantly share code, notes, and snippets.

@webtoffee-git
Created November 5, 2024 11:24
Show Gist options
  • Save webtoffee-git/ad17ef45d56a22c700276975a18c4038 to your computer and use it in GitHub Desktop.
Save webtoffee-git/ad17ef45d56a22c700276975a18c4038 to your computer and use it in GitHub Desktop.
Code snippet to modify the order date format in documents - By WebToffee( WooCommerce PDF Invoice, Packing Slips, Delivery Notes and Shipping labels (free))
<?php //Do not add this line of code
add_filter('wf_pklist_alter_order_date', 'wt_pklist_change_order_date_format', 10, 3);
function wt_pklist_change_order_date_format($order_date, $template_type, $order) {
if ( is_object( $order ) ) {
$order_id = is_object($order) ? $order->get_id() : '';
$order_date_format = 'd/m/y';
$order_date = get_the_date( $order_date_format, $order_id );
}
return $order_date;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment