Forked from matheuswd/custom_pdf_tag_donor_title.php
Created
September 7, 2022 19:05
-
-
Save alexwcoleman/758ed0b0dd1cbe04431b54520f0bb255 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