Home › Forums › General Issues › Custom role can't save HTML into TextArea field › Reply To: Custom role can't save HTML into TextArea field
This is a dirty fix I’ve come up with:
add_filter(
'wp_kses_allowed_html',
function ( $tags, $context ) {
if ( 'post' !== $context ) {
return $tags;
}
// There's a bug with ACF where iframes are not allowed in content if you are using a custom role.
$tags['iframe'] = array(
'src' => array(),
'height' => array(),
'width' => array(),
'frameborder' => array(),
'allowfullscreen' => array(),
'title' => array(),
'mozallowfullscreen' => array(),
'webkitallowfullscreen' => array(),
'allow' => array(),
'xr-spatial-tracking' => array(),
'execution-while-out-of-viewport' => array(),
'execution-while-not-rendered' => array(),
'web-share' => array(),
);
return $tags;
},
10,
2
);
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.