Last active
January 3, 2016 20:29
-
-
Save mjn666/8515293 to your computer and use it in GitHub Desktop.
What it says on the tin
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
/** | |
* Embed HealCode | |
* {@link https://www.healcode.com} | |
* Usage: [healcode id="_ID_" name="_NAME_"] | |
*/ | |
if ( ! function_exists(healcode_shortcode) ) { | |
function healcode_shortcode($atts, $content = null) { | |
extract(shortcode_atts(array( | |
'id' => '', | |
'name' => '' | |
), $atts )); | |
ob_start(); ?> | |
<div class="healcode"> | |
<script type="text/javascript"> | |
healcode_widget_id = '<?php echo $id ?>'; | |
healcode_widget_name = '<?php echo $name ?>'; | |
healcode_widget_type = "mb"; | |
document.write(unescape("%3Cscript src='https://www.healcode.com/javascripts/hc_widget.js' type='text/javascript'%3E%3C/script%3E")); | |
</script> | |
<noscript>Please enable Javascript in order to get <a href="https://www.healcode.com" target="_blank">HealCode</a> functionality</noscript> | |
</div> | |
<?php | |
$html = ob_get_clean(); | |
return $html; | |
} | |
} | |
add_shortcode('healcode', 'healcode_shortcode'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment