Last active
March 21, 2019 13:39
-
-
Save haet/23c635968ecb7d88f39a989703011c76 to your computer and use it in GitHub Desktop.
Add custom Placeholder / Shortcode to Mailbuilder
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( 'haet_mail_placeholder_menu', 'add_mailbuilder_placeholder' ); | |
add_filter( 'haet_mail_order_placeholders', 'populate_mailbuilder_placeholder', 10, 3 ); | |
function add_mailbuilder_placeholder( $placeholder_menu ){ | |
if( is_array( $placeholder_menu ) ){ | |
$placeholder_menu[] = array( | |
'text' => 'My Placholder Name', | |
'tooltip' => '[MY_PLACEHOLDER]', | |
); | |
} | |
return $placeholder_menu; | |
} | |
function populate_mailbuilder_placeholder( $order, $wc_order, $settings ){ | |
$order['my_placeholder'] = 'your value'; | |
return $order; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment