Last active
July 11, 2024 10:27
-
-
Save wplit/bc93ffb67d03fd1464843bfd9fd504a2 to your computer and use it in GitHub Desktop.
allow iframe tags in ACF field
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
<?php | |
/* allow iframe tags */ | |
add_filter( 'wp_kses_allowed_html', 'acf_add_allowed_iframe_tag', 10, 2 ); | |
function acf_add_allowed_iframe_tag( $tags, $context ) { | |
if ( $context === 'post' ) { | |
$tags['iframe'] = array( | |
'src' => true, | |
'height' => true, | |
'width' => true, | |
'frameborder' => true, | |
'allowfullscreen' => true, | |
); | |
} | |
return $tags; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment