Created
February 19, 2016 01:52
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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