monsterinsights_sanitize_rich_editor_field

Sanitize rich editor fields.

Description

(string) monsterinsights_sanitize_rich_editor_field( (array) $input ); 

Returns (string)

$input Sanitizied value

Parameters (1)

0. $input (array)
The field value

Usage

  1. if ( !function_exists( 'monsterinsights_sanitize_rich_editor_field' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'google-analytics-for-wordpress-by-monsterinsights/includes/admin/settings/settings-api.php'; 
  3.  
  4. // The field value 
  5. $input = array(); 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = monsterinsights_sanitize_rich_editor_field($input); 
  9.  

Defined (1)

The function is defined in the following location(s).

/includes/admin/settings/settings-api.php  
  1. function monsterinsights_sanitize_rich_editor_field( $input ) { 
  2. $tags = array( 
  3. 'p' => array( 
  4. 'class' => array(),  
  5. 'id' => array(),  
  6. ),  
  7. 'span' => array( 
  8. 'class' => array(),  
  9. 'id' => array(),  
  10. ),  
  11. 'a' => array( 
  12. 'href' => array(),  
  13. 'title' => array(),  
  14. 'class' => array(),  
  15. 'title' => array(),  
  16. 'id' => array(),  
  17. ),  
  18. 'strong' => array(),  
  19. 'em' => array(),  
  20. 'br' => array(),  
  21. 'img' => array( 
  22. 'src' => array(),  
  23. 'title' => array(),  
  24. 'alt' => array(),  
  25. 'id' => array(),  
  26. ),  
  27. 'div' => array( 
  28. 'class' => array(),  
  29. 'id' => array(),  
  30. ),  
  31. 'ul' => array( 
  32. 'class' => array(),  
  33. 'id' => array(),  
  34. ),  
  35. 'li' => array( 
  36. 'class' => array(),  
  37. 'id' => array(),  
  38. ); 
  39.  
  40. //$allowed_tags = apply_filters( 'monsterinsights_allowed_html_tags', $tags ); 
  41.  
  42. return trim( wp_kses( $input, $allowed_tags ) );