format_to_edit( string $content, bool $rich_text = false )
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 ‘format_to_edit’ filter.
参数
- $content
-
(string)
(Required)
The text about to be edited. - $rich_text
-
(bool)
(Optional)
Whether$content
should be considered rich text, in which case it would not be passed through esc_textarea().Default value: false
返回值
(string) The text after the filter (and possibly htmlspecialchars()) has been run.
源代码
File: wp-includes/formatting.php
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;
}
更新日志
Version | 描述 |
---|---|
4.4.0 | The $richedit parameter was renamed to $rich_text for clarity. |
0.71 | Introduced. |
相关函数
Uses
-
wp-includes/formatting.php:
esc_textarea() -
wp-includes/formatting.php:
format_to_edit -
wp-includes/plugin.php:
apply_filters()
Used By
-
wp-admin/includes/comment.php:
get_comment_to_edit() -
wp-includes/post.php:
sanitize_post_field()
你可能对这些文章感兴趣:
- wordpress函数get_the_title()用法示例
- wordpress函数get_the_posts_navigation()用法示例
- wordpress函数get_the_terms()用法示例
- wordpress函数get_the_tags()用法示例
- wordpress函数get_the_taxonomies()用法示例
- wordpress函数get_the_permalink()用法示例
- wordpress函数get_the_password_form()用法示例
- wordpress函数get_the_posts_pagination()用法示例
- wordpress函数get_the_modified_date()用法示例
- wordpress函数get_the_modified_time()用法示例
- wordpress函数get_the_modified_author()用法示例
- wordpress函数get_the_guid()用法示例
- wordpress函数get_the_ID()用法示例
- wordpress函数get_the_excerpt()用法示例
如有疑问,请前往问答中心反馈!
反馈