wp_richedit_pre

Definition:
function wp_richedit_pre($text) {}

Formats text for the rich text editor.
The filter ‘richedit_pre’ is applied here. If $text is empty the filter will be applied to an empty string.

Parameters

  • string $text: The text to be formatted.

Return values

returns:The formatted text after filter is applied.

Defined filters

  • richedit_pre
    apply_filters('richedit_pre', '')
  • richedit_pre
    apply_filters('richedit_pre', $output)

Source code

function wp_richedit_pre($text) {

	// Filtering a blank results in an annoying <br />\n

	if ( empty($text) ) return apply_filters('richedit_pre', '');



	$output = convert_chars($text);

	$output = wpautop($output);

	$output = htmlspecialchars($output, ENT_NOQUOTES);



	return apply_filters('richedit_pre', $output);

}

4067

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: