The $content is run through esc_textarea(), which uses htmlspecialchars() to convert special characters to HTML entities. If $richedit is set to true, it is simply a holder for the 'format_to_edit' filter.
Parameters
$contentstring
The text about to be edited.
$rich_textbooloptional
Whether $content should be considered rich text, in which case it would not be passed through esc_textarea(). Default false.Default: false
Return
string
The text after the filter (and possibly htmlspecialchars()) has been run.
Hooks fired · 1
One hook fires while format_to_edit() runs, in this order:
2756functionformat_to_edit($content,$rich_text=false){2757/**2758 * Filters the text to be formatted for editing.2759 *2760 * @since 1.2.02761 *2762 * @param string $content The text, prior to formatting for editing.2763 */2764$content=apply_filters('format_to_edit',$content);2765if(!$rich_text){2766$content=esc_textarea($content);2767}2768return$content;2769}
History
Introduced in 0.71. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
4.4.0
The $richedit parameter was renamed to $rich_text for clarity.from the docblock
0.71
Introduced.from the docblock
About this page
Parsed data
Generated from the wordpress-develop 6.9.7 tag, from src/wp-includes/formatting.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.