Advertisement
sandy786

Untitled

Apr 23rd, 2013
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. /*
  2. * This is an example of how to override a default filter
  3. * for 'textarea' sanitization and $allowedposttags + embed and script.
  4. */
  5. add_action('admin_init','optionscheck_change_santiziation', 100);
  6.  
  7. function optionscheck_change_santiziation() {
  8. remove_filter( 'of_sanitize_textarea', 'of_sanitize_textarea' );
  9. add_filter( 'of_sanitize_textarea', 'custom_sanitize_textarea' );
  10. }
  11.  
  12. function custom_sanitize_textarea($input) {
  13. global $allowedposttags;
  14. $custom_allowedtags["embed"] = array(
  15. "src" => array(),
  16. "type" => array(),
  17. "allowfullscreen" => array(),
  18. "allowscriptaccess" => array(),
  19. "height" => array(),
  20. "width" => array()
  21. );
  22. $custom_allowedtags["script"] = array();
  23.  
  24. $custom_allowedtags = array_merge($custom_allowedtags, $allowedposttags);
  25. $output = wp_kses( $input, $custom_allowedtags);
  26. return $output;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement