Skip to content

Instantly share code, notes, and snippets.

@andrewlimaza
Created December 11, 2024 05:44
Show Gist options
  • Save andrewlimaza/d9419b696c306f6455d03446d3fc955c to your computer and use it in GitHub Desktop.
Save andrewlimaza/d9419b696c306f6455d03446d3fc955c to your computer and use it in GitHub Desktop.
Show order/invoice status in PMPro PDF
<?php
/**
* Add custom variables to PDF template editor to show some more order information.
* To add this code to your site, please visit - https://yoohooplugins.com/customize-wordpress/
*/
function my_pmpro_pdf_status_details( $data_array, $user, $order_data ) {
$data_array['{{order_status}}'] = esc_html( $order_data->status );
return $data_array;
}
add_filter( 'pmpro_pdf_invoice_custom_variables', 'my_pmpro_pdf_status_details', 10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment