Created
December 13, 2017 06:13
-
-
Save SirDarcanos/eae71b484a8f667f8309ba219e8bc4c8 to your computer and use it in GitHub Desktop.
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 | |
function wc_pdf_watermark_extend_template_tags( $parsed_text, $unparsed_text, $order, $product ) { | |
// Look for {product_title} in text and replace it with the product title | |
$parsed_text = str_replace( '{product_title}', $product->get_title(), $parsed_text ); | |
return $parsed_text; | |
} | |
add_filter( 'woocommerce_pdf_watermark_parse_template_tags', 'wc_pdf_watermark_extend_template_tags', 10, 4 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment