wp_richedit_pre

Formats text for the rich text editor.

Description

(string) wp_richedit_pre( (string) $text ); 

The filter is applied here. If $text is empty the filter will be applied to an empty string.

Returns (string)

The formatted text after filter is applied.

Parameters (1)

0. $text (string)
The text to be formatted.

Usage

  1. if ( !function_exists( 'wp_richedit_pre' ) ) { 
  2. require_once ABSPATH . WPINC . '/deprecated.php'; 
  3.  
  4. // The text to be formatted. 
  5. $text = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wp_richedit_pre($text); 
  9.  

Defined (1)

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

/wp-includes/deprecated.php  
  1. function wp_richedit_pre($text) { 
  2. _deprecated_function( __FUNCTION__, '4.3.0', 'format_for_editor()' ); 
  3.  
  4. if ( empty( $text ) ) { 
  5. /** 
  6. * Filters text returned for the rich text editor. 
  7. * This filter is first evaluated, and the value returned, if an empty string 
  8. * is passed to wp_richedit_pre(). If an empty string is passed, it results 
  9. * in a break tag and line feed. 
  10. * If a non-empty string is passed, the filter is evaluated on the wp_richedit_pre() 
  11. * return after being formatted. 
  12. * @since 2.0.0 
  13. * @deprecated 4.3.0 
  14. * @param string $output Text for the rich text editor. 
  15. */ 
  16. return apply_filters( 'richedit_pre', '' ); 
  17.  
  18. $output = convert_chars($text); 
  19. $output = wpautop($output); 
  20. $output = htmlspecialchars($output, ENT_NOQUOTES, get_option( 'blog_charset' ) ); 
  21.  
  22. /** This filter is documented in wp-includes/deprecated.php */ 
  23. return apply_filters( 'richedit_pre', $output );