Last active
March 16, 2016 11:58
-
-
Save wpweb101/ed3040882c95be47d1e5 to your computer and use it in GitHub Desktop.
Add custom shortcode in download PDF
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 | |
| /** | |
| * Adding Custom shortcode value in PDF voucher | |
| */ | |
| function woo_vou_pdf_template_replace_shortcodes( $voucher_template_html, $orderid, $item_key, $items, $voucodes, $productid ) { | |
| // replace {your_shortcode} with actual value | |
| $voucher_template_html = str_replace( '{your_shortcode}', $your_shortcode_value, $voucher_template_html ); | |
| return $voucher_template_html; | |
| } | |
| // Add filter to replace voucher template shortcodes in download pdf | |
| add_filter('woo_vou_pdf_template_inner_html', 'woo_vou_pdf_template_replace_shortcodes', 10, 6 ); | |
| ?> |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Put the code in theme functions.php so you don't loss the changes after updating plugin