Created
November 5, 2024 11:24
-
-
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))
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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