Created
April 8, 2020 16:21
-
-
Save ChromeOrange/2de923beb26fe6a1d0c560af1b267032 to your computer and use it in GitHub Desktop.
Add transaction ID to PDF Invoices payment method
This file contains hidden or 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
add_filter( 'pdf_invoice_payment_method_title', 'custom_pdf_invoice_payment_method_title', 10, 2 ); | |
function custom_pdf_invoice_payment_method_title( $payment_method_title, $order_id ) { | |
$transaction_id = get_post_meta( $order_id, '_transaction_id', TRUE ); | |
if( isset( $transaction_id ) && $transaction_id != '' ) { | |
$payment_method_title .= "<br />(" . $transaction_id . ")"; | |
} | |
return $payment_method_title; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment