I have a plugin which uses this shortcode: [daisy]
And the html output of this shortcode is : <a class="clickable">Click Here</a>
Plugin is working perfect if I use the shortcode to trigger the plugin. It works with this also:
<?php echo do_shortcode('[daisy]'); ?>
Normally it should work also with the
<a class="clickable">Click Here</a>
directly but it's not working, the link appears but if I click on it nothing happens.
This shortcode triggers some javascript to load :
<script type="text/javascript">
$(document).ready(function(){
// Init Plugin
$(".clickable").contactpopup({
'style' : '<?php echo $wp_cpup_theme; ?>',
'bgcolor' : '<?php echo $wp_cpup_color; ?>',
'formelement' : '#Form_PopContactUs',
'effect' : '<?php echo $wp_cpup_effect; ?>',
'header' : '<?php echo $wp_cpup_popup_title; ?>'
});
});
</script>
So, it should work fine also with the html.
Any ideas why if I click the <a>
element is working and if I use
<?php echo do_shortcode('[daisy]'); ?>
it's triggering the plugin (contact form popup).
Here is the demo with the contact form if you want to take a look.
Any suggestions ?
Handler for shortcode:
/*--------------------------------
Shortcode
----------------------------------*/
add_shortcode("daisy", "wp_contact_popup_short_code_handler");
function wp_contact_popup_short_code_handler() {
$demolph_output = wp_contact_popup_short_code_posts_function();
return $demolph_output;
}
function wp_contact_popup_short_code_posts_function( $content = null ) {
// Grab Globals
global $wp_cpup_popup_link;
global $wp_cpup_popup_email;
global $wp_cpup_popup_thanks;
global $wp_cpup_form_html;
global $wp_cpup_email_message;
?>