Skip to content

Instantly share code, notes, and snippets.

@ChromeOrange
Created February 26, 2018 11:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChromeOrange/c611c582337331522fab2a571f590789 to your computer and use it in GitHub Desktop.
Save ChromeOrange/c611c582337331522fab2a571f590789 to your computer and use it in GitHub Desktop.
Add billing field to Billing section, eg mobile number.
// Add billing field to Billing section, eg mobile number.
// Uses a placeholder [[PDFBILLINGMOBILE]] in the template file
add_filter( 'pdf_content_additional_content', 'custom_pdf_content_additional_content', 10, 2 );
function custom_pdf_content_additional_content( $content, $order_id ) {
$content = str_replace( '[[PDFBILLINGMOBILE]]', get_post_meta( $order_id,'mobile',TRUE ), $content );
return $content;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment