Support

Account

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
    );