Created
March 31, 2020 16:48
-
-
Save andrewlimaza/b757669370b9a5f41073db5b8213c460 to your computer and use it in GitHub Desktop.
Add custom variables to PMPro PDF Invoices Templates
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
<?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