How to call a function inside an iframe

I’ve made a function in wordpress with which I call an id into every post thru a shortcode. The function is:

function myshortcode_imdbid( ){
   $id = dt_get_meta('ids');
   return trim($id, 't');
add_shortcode( 'post_imdbid', 'myshortcode_imdbid' );

This function will print in every post a different id made of digits like: 232121

What I want to do is to call that ID into an iframe, do you have any idea on how to do that. Placing the shortcode inside the iframe won’t work.

The iframe is always the same, only the ID is not the same. The iframe looks like:

<iframe class="API" frameborder="0" scrolling="no" data-apikey="XXXXXXXXXXXX" data-imdbid="HERE I MUST CALL MY ID"></iframe>

Do I need another function using that iframe and replace only the digits? If, so, any ideas?
Big thanks for reading this and I hope that someone can help.

Read more here: How to call a function inside an iframe

Leave a Reply

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