Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChromeOrange/2de923beb26fe6a1d0c560af1b267032 to your computer and use it in GitHub Desktop.
Save ChromeOrange/2de923beb26fe6a1d0c560af1b267032 to your computer and use it in GitHub Desktop.
Add transaction ID to PDF Invoices payment method
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