Support » Plugin: PHP Code for posts » How to pass html with quotes to the param in shortcode

  • I’m trying to create a snippet that will embed a youtube video and then a link. I need to pass the video and link as variables in the shortcode. The video works fine, but I don’t know how to pass the link. Here’s the snippet:

    
    <div class="videowrapper">
    <div class="videocontainer" itemprop="video">
    <iframe width="775" height="436" src="https://www.youtube.com/embed/<?php echo $video; ?>" frameborder="0" allowfullscreen></iframe>
    </div>
    <?php echo $caption; ?>
    </div>
    

    Here’s the shortcode:

    
    [php snippet=1 param="video=Du5KKQKEw84&caption=<a href="http://www.link.com">Link</a>"]
    

    Obviously, the quotes in the link are going to be an issue. I tried escaping them, but that didn’t help. Any ideas?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘How to pass html with quotes to the param in shortcode’ is closed to new replies.