Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: richedit_pre

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

This hook occurs 2 times in this file.

Line Code
2528  * be applied to an empty string.
2529  *
2530  * @since 2.0.0
2531  *
2532  * @param string $text The text to be formatted.
2533  * @return string The formatted text after filter is applied.
2534  */
2535 function wp_richedit_pre($text) {
2536      // Filtering a blank results in an annoying <br />\n
2537      if ( empty($text) ) return apply_filters('richedit_pre', '');
2538
2539      $output = convert_chars($text);
2540      $output = wpautop($output);
2541      $output = htmlspecialchars($output, ENT_NOQUOTES, get_option( 'blog_charset' ) );
2542
2543      return apply_filters('richedit_pre', $output);
2544 }
2545
2546 /**
2547  * Formats text for the HTML editor.
2548  *
2549  * Unless $output is empty it will pass through htmlspecialchars before the
2550  * 'htmledit_pre' filter is applied.
2551  *
2552  * @since 2.5.0