Making ifame work with variable in wordpress

I have created a custom meta field and I would like to save an iframe link on my posts.

When I retrieve the link from my meta field with the code below:

echo soundcloud_get_meta( 'soundcloud_soundcloud_shortcode' );

I get the whole iframe as a text!

But when I give the link as in the code below it works

echo '<iframe width="100%" height="450" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/151456970&amp;auto_play=false&amp;hide_related=false&amp;show_comments=true&amp;show_user=true&amp;show_reposts=false&amp;visual=true"></iframe>';

I think it puts extra quotes on the first example and get as a text.
How can I make this work with the first example?

Read more here: Making ifame work with variable in wordpress

Leave a Reply

Your email address will not be published. Required fields are marked *