Created
August 17, 2018 09:01
-
-
Save dennisnissle/ba5625f6f7005836bb2b0c514bf54495 to your computer and use it in GitHub Desktop.
Add your own invoice shortcode example
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 | |
add_filter( 'wc_gzdp_invoice_shortcodes', 'my_child_add_invoice_shortcode', 10, 1 ); | |
function my_child_add_invoice_shortcode( $shortcodes ) { | |
$shortcodes['example_shortcode_name'] = 'my_child_example_shortcode_name'; | |
return $shortcodes; | |
} | |
function my_child_example_shortcode_name( $atts, $content = '' ) { | |
$order = WC_GZDP_Invoice_Shortcodes::get_order(); | |
if ( ! $order ) { | |
return; | |
} | |
// Check the order and output your data/content | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment