Skip to content

Instantly share code, notes, and snippets.

@rickalday
Created October 19, 2022 23:38
Show Gist options
  • Save rickalday/c7d20cad04b036821bf382699abf02b3 to your computer and use it in GitHub Desktop.
Save rickalday/c7d20cad04b036821bf382699abf02b3 to your computer and use it in GitHub Desktop.
PDF Complete Date Tag
<?php
function give_add_complete_date_pdf_tag( $template_content, $args ) {
//$completedate = $args['payment_meta']['_give_completed_date'];
$completedate = date_i18n( get_option( 'date_format' ), strtotime( $args['payment_meta']['_give_completed_date'] ) );
$template_content = str_replace( '{completedate}', $completedate, $template_content );
return $template_content;
}
add_filter( 'give_pdf_compiled_template_content', 'give_add_complete_date_pdf_tag', 999, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment