函数文档

_wp_footnotes_kses_init_filters()

💡 云策文档标注

概述

_wp_footnotes_kses_init_filters() 函数用于为脚注元字段添加过滤器,确保在用户没有 unfiltered_html 权限时或导入数据时进行安全过滤。

关键要点

  • 函数通过 add_filter() 将 _wp_filter_post_meta_footnotes 回调添加到 sanitize_post_meta_footnotes 过滤器钩子
  • 主要用于脚注元字段的过滤,防止不安全内容,增强 WordPress 安全性
  • 在 WordPress 6.3.2 版本中引入,是脚注功能的一部分

注意事项

  • 此函数通常由 _wp_footnotes_kses_init() 或 _wp_footnotes_force_filtered_html_on_import_filter() 调用,开发者无需直接调用
  • 确保用户权限和导入场景下的数据过滤,避免绕过安全机制

📄 原文内容

Adds the filters for footnotes meta field.

Source

function _wp_footnotes_kses_init_filters() {
	add_filter( 'sanitize_post_meta_footnotes', '_wp_filter_post_meta_footnotes' );
}

Changelog

Version Description
6.3.2 Introduced.