format_to_edit()
Проверено на WordPress 6.9, обновлено Источник: WordPress Developer Resources.
Сигнатура
format_to_edit( string $content, bool $rich_text = false ): string
Описание
$content пропускается через esc_textarea() , который использует htmlspecialchars() для преобразования специальных символов в HTML-сущности. Если $richedit установлен в true, функция служит просто держателем для фильтра ‘format_to_edit’.
Оригинал (английский)
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.
Параметры
$content
string
обязательный
$rich_text
bool
необязательный
= false
Возвращаемое значение
string
Исходный код
wp-includes/formatting.php:2759
function format_to_edit( $content, $rich_text = false ) {
/**
* Filters the text to be formatted for editing.
*
* @since 1.2.0
*
* @param string $content The text, prior to formatting for editing.
*/
$content = apply_filters( 'format_to_edit', $content );
if ( ! $rich_text ) {
$content = esc_textarea( $content );
}
return $content;
}
История изменений
| Версия | Описание |
|---|---|
| 4.4.0 | The $richedit parameter was renamed to $rich_text for clarity. |
| 0.71 | Introduced. |

