Posted By

bitsculptor on 03/26/13


Tagged

iframe wordpress shortcode


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

zemonte
b83s
qing606


Simple iframe shortcode for wordpress


 / Published in: PHP
 

this is a simple script to take iframe parameters and build an iframe via a shortcode

  1. add_shortcode('iframe', 'iframe');
  2. function iframe($atts) {
  3. extract(shortcode_atts(array(
  4. 'src' => "",
  5. 'width' => "800",
  6. 'height' => "600"
  7. ), $atts));
  8.  
  9. $iframe = '<iframe src="'.$src.'" width="'.$width.'" height="'.$height.'" scrolling="no" allowtransparency="yes" frameborder="0" ></iframe>';
  10.  
  11. return $iframe;
  12. }

Report this snippet  

You need to login to post a comment.