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
1048           '♥' => '♥',
1049           '♦' => '♦'
1050      );
1051
1052      return str_replace( array_keys($to_ncr), array_values($to_ncr), $text );
1053 }
1054
1055 function wp_richedit_pre($text) {
1056      // Filtering a blank results in an annoying <br />\n
1057      if ( empty($text) ) return apply_filters('richedit_pre', '');
1058
1059      $output = $text;
1060      $output = convert_chars($output);
1061      $output = wpautop($output);
1062
1063      // These must be double-escaped or planets will collide.
1064      $output = str_replace('&lt;', '&amp;lt;', $output);
1065      $output = str_replace('&gt;', '&amp;gt;', $output);
1066
1067      return apply_filters('richedit_pre', $output);
1068 }
1069
1070 function clean_url( $url, $protocols = null ) {
1071      if ('' == $url) return $url;
1072      $url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%]|i', '', $url);
1073      $strip = array('%0d', '%0a');
1074      $url = str_replace($strip, '', $url);
1075      $url = str_replace(';//', '://', $url);
1076      $url = (!strstr($url, '://')) ? 'http://'.$url : $url;