Created
September 7, 2022 11:02
-
-
Save matheuswd/24c0780dfd6ce776ac0688bc16d8cf8c to your computer and use it in GitHub Desktop.
Creates the {donor_title} tag for the GiveWP PDF Receipt
This file contains 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 | |
function custom_pdf_tag_donor_title( $template_content, $args ) { | |
$donor_title = isset( $args['buyer_info']['title'] ) && $args['buyer_info']['title'] !== '' ? $args['buyer_info']['title'] : __('', 'give'); | |
$template_content = str_replace( '{donor_title}', $donor_title, $template_content ); | |
return $template_content; | |
} | |
add_filter( 'give_pdf_compiled_template_content', 'custom_pdf_tag_donor_title', 999, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment