plugin shortcode output

I have a plugin which uses this shortcode: [daisy]

And the html output of this shortcode is : <a class="clickable">Click Here</a>

Read More

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>
but it’s not working, the link appears but if I click on it nothing happens.

I want to use the html output because my website is using a lot of javascript for displaying html content I cannot use php shortcodes inside javascript/jquery functions.

So, do you have any suggestions for this issue?
Because I think the shortcode should work also with the html output which triggers that plugin (in my case is a contact form popup)
Thanks!
Later edit: This is the javascript which triggers the plugin:

<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; ?>'
    });
});

Related posts

Leave a Reply

1 comment

  1. If you open the plugin file and find where the function add_shortcode(‘daisy’,’someotherfunction’); is, then you could simply call that function that the shortcode is pointing too.

    This code could be placed as follows in a plugin or the functions.php file of your theme:

    add_action( 'admin_init', 'daisy_fun' );
    
    function daisy_fun(){
    ?>
            <script type="text/javascript" defer="defer">
                      jQuery(document).ready(function(){
                            var daisyLink = '<?php echo wp_contact_popup_short_code_handler(); ?>';
                      });
            </script>
    <?php
    }