format_to_edit
函数
format_to_edit ( $content, $rich_text = false )
- 参数
-
-
(string)
$content
The text about to be edited.- Required: 是
-
(bool)
$rich_text
Optional. Whether `$content` should be considered rich text, in which case it would not be passed through esc_textarea(). Default false.- Required: 否
- Default: false
-
(string)
- 返回值
-
- (string) The text after the filter (and possibly htmlspecialchars()) has been run.
- 定义位置
-
-
wp-includes/formatting.php
, line 2702
-
wp-includes/formatting.php
- 引入
- 0.71
- 弃用
- –
Acts on text which is about to be edited.
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 {@see ‘format_to_edit’} filter.
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; }
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。