Skip to content

Instantly share code, notes, and snippets.

@aaronreimann
Created February 19, 2016 01:52
Show Gist options
  • Save aaronreimann/f584d958abc321164b99 to your computer and use it in GitHub Desktop.
Save aaronreimann/f584d958abc321164b99 to your computer and use it in GitHub Desktop.
Add this to your functions.php in your theme to allow WordPress to display <iframe>'s
add_filter( 'wp_kses_allowed_html', 'ar_allowed_tags_filter', 1, 1 );
function ar_allowed_tags_filter( $allowed_tags ) {
if ( ! current_user_can( 'publish_posts' ) ) {
return $allowedposttags;
}
$allowed_tags['iframe'] = array(
'align' => true,
'class' => true,
'frameborder' => true,
'height' => true,
'id' => true,
'name' => true,
'marginheight' => true,
'scrolling' => true,
'src' => true,
'style' => true,
'marginwidth' => true,
'width' => true,
);
return $allowed_tags;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment