Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewlimaza/b757669370b9a5f41073db5b8213c460 to your computer and use it in GitHub Desktop.
Save andrewlimaza/b757669370b9a5f41073db5b8213c460 to your computer and use it in GitHub Desktop.
Add custom variables to PMPro PDF Invoices Templates
<?php
/**
* This example shows you how to create custom variables for your email templates.
* All customers that have purchased an 'All Access' pass get up to 5 custom variables created to help get you started.
* https://yoohooplugins.com/all-access
*/
function my_custom_pmpro_pdf_variable( $data_array, $user, $order_data ) {
$data_array['{{user_name_example}}'] = $user->user_nicename;
return $data_array;
}
add_filter( 'pmpro_pdf_invoice_custom_variables', 'my_custom_pmpro_pdf_variable', 10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment