'http://www.youtube.com/embed/dUpTjDqjQoo', 'width' => '100%', 'height' => '500', 'scrolling' => 'yes', 'class' => 'iframe-class', 'frameborder' => '0' ); $allowed_tags = array( 'h1' => array(), 'h2' => array(), 'h3' => array(), 'h4' => array(), 'h5' => array(), 'h6' => array(), 'p' => array(), 'a' => array( 'href' => true, 'title' => true, ), 'br' => array(), 'em' => array(), 'strong' => array() ); foreach ( $defaults as $default => $value ) { // add defaults if ( ! @array_key_exists( $default, $atts ) ) { // mute warning with "@" when no params at all $atts[$default] = $value; } } $html = "\n".''."\n"; $html .= ' $value ) { if ( strtolower($attr) == 'src' ) { // sanitize url $value = esc_url( $value ); } if ( strtolower($attr) == 'srcdoc' ) { // sanitize html $value = wp_kses( $value, $allowed_tags ); $value = esc_html( $value ); } // Remove all attributes starting with "on". Examples: onload, onmouseover, onfocus, onpageshow, onclick if ( strpos( strtolower( $attr ), 'on' ) !== 0 ) { if ( $value != '' ) { // adding all attributes $html .= ' ' . esc_attr( $attr ) . '="' . esc_attr( $value ) . '"'; } else { // adding empty attributes $html .= ' ' . esc_attr( $attr ); } } } $html .= '>'."\n"; if ( isset( $atts["same_height_as"] ) ) { $html .= ' '; } return $html; } add_shortcode( 'iframe', 'iframe_plugin_add_shortcode_cb' ); function iframe_plugin_row_meta_cb( $links, $file ) { if ( $file == plugin_basename( __FILE__ ) ) { $row_meta = array( 'support' => '' . __( 'Iframe', 'iframe' ) . '', 'donate' => '' . __( 'Donate', 'iframe' ) . '', 'pro' => '' . __( 'Advanced iFrame Pro', 'iframe' ) . '' ); $links = array_merge( $links, $row_meta ); } return (array) $links; } add_filter( 'plugin_row_meta', 'iframe_plugin_row_meta_cb', 10, 2 );