Created
May 17, 2023 09:56
-
-
Save woogists/457769ebf0b95e4cc8f28218661f15e4 to your computer and use it in GitHub Desktop.
Replace Xero's default Order Created date with today's date
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 | |
add_filter('woocommerce_xero_invoice_date', 'change_xero_invoice_date_to_current_date', 10, 1); | |
add_filter('woocommerce_xero_invoice_due_date', 'change_xero_invoice_date_to_current_date', 10, 1); | |
function change_xero_invoice_date_to_current_date($date) { | |
// Get today's date in YYYY-MM-DD format | |
$today = date('Y-m-d'); | |
// Return today's date instead of the original invoice/payment due date | |
return $today; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment