钩子文档

richedit_pre

💡 云策文档标注

概述

richedit_pre 是一个 WordPress 过滤器,用于过滤返回给富文本编辑器的文本。它在 wp_richedit_pre() 函数中被调用,根据传入字符串是否为空来影响输出格式。

关键要点

  • 当传入空字符串时,过滤器首先被评估并返回结果,可能导致输出换行标签和换行符。
  • 当传入非空字符串时,过滤器在 wp_richedit_pre() 返回格式化后的文本上被评估。
  • 该过滤器已从 WordPress 4.3.0 版本起被弃用。

注意事项

  • 由于已弃用,建议在开发新功能时避免使用此过滤器,转而使用更现代的替代方案。

📄 原文内容

Filters text returned for the rich text editor.

Description

This filter is first evaluated, and the value returned, if an empty string is passed to wp_richedit_pre() . If an empty string is passed, it results in a break tag and line feed.

If a non-empty string is passed, the filter is evaluated on the wp_richedit_pre() return after being formatted.

Parameters

$outputstring
Text for the rich text editor.

Source

return apply_filters( 'richedit_pre', '' );

Changelog

Version Description
4.3.0 Deprecated.
2.0.0 Introduced.