Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * This is an example of how to override a default filter
- * for 'textarea' sanitization and $allowedposttags + embed and script.
- */
- add_action('admin_init','optionscheck_change_santiziation', 100);
- function optionscheck_change_santiziation() {
- remove_filter( 'of_sanitize_textarea', 'of_sanitize_textarea' );
- add_filter( 'of_sanitize_textarea', 'custom_sanitize_textarea' );
- }
- function custom_sanitize_textarea($input) {
- global $allowedposttags;
- $custom_allowedtags["embed"] = array(
- "src" => array(),
- "type" => array(),
- "allowfullscreen" => array(),
- "allowscriptaccess" => array(),
- "height" => array(),
- "width" => array()
- );
- $custom_allowedtags["script"] = array();
- $custom_allowedtags = array_merge($custom_allowedtags, $allowedposttags);
- $output = wp_kses( $input, $custom_allowedtags);
- return $output;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement