钩子文档

wp_default_editor

💡 云策文档标注

概述

wp_default_editor 是一个 WordPress 过滤器,用于控制默认显示的编辑器类型。它允许开发者通过钩子修改默认编辑器设置。

关键要点

  • 这是一个过滤器钩子,用于指定默认编辑器,可选值包括 'tinymce'、'html' 或 'test'。
  • 参数 $r 是一个字符串,表示要显示的默认编辑器类型。
  • 在 wp-includes/general-template.php 文件中定义,由 wp_default_editor() 函数使用。
  • 自 WordPress 2.5.0 版本引入。

📄 原文内容

Filters which editor should be displayed by default.

Parameters

$rstring
Which editor should be displayed by default. Either 'tinymce', 'html', or 'test'.

Source

return apply_filters( 'wp_default_editor', $r );

Changelog

Version Description
2.5.0 Introduced.