0

Is there a way to allow my users to add HTML5 video tag (without shortcodes) into my textfield/textarea? Allowed anchor styles and bold tags are working, but as soon I add 'video' and 'source' it doesn't work anymore:(
Any help is appreciated. Thx.

function validate_setting($plugin_options){ 
    //This Works
    $allowed_html = array(
     'a' => array(
    'href' => array (),
    'title' => array ()),
    //This works also
    'b' => array(
    'style'=> array(),
    ),
     //This is not working...
    'video' = array(
    'width' => true,
    'height' => true
     ),
     //This also is not working...
    'source' = array(
    'src' => true,
    'type' => true
     ),
     );


$plugin_options['text_area']= wp_kses($plugin_options['text_area'],$allowed_html);
return $plugin_options;
}

1 Answer 1

0

Ok This Thread did helped me a LOT!

So now my function works (i can embeld HTML5 videos) and it looks like this:

function validate_setting($plugin_options){ 

global $allowedtags;
$allowedtags = array(
'a' => array(
'href' => array (),
'title' => array ()),
'b' => array(
'style'=> array(),
),
);

$allowedtags['video'] = array(
    'width' => true,
    'height' => true
);
$allowedtags['source'] = array(
    'src' => true,
    'type' => true
);

$plugin_options['text_area'] = wp_kses($plugin_options['text_area'],$allowedtags);
 return $plugin_options;
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.