函数文档

block_core_file_ensure_interactivity_dependency()

💡 云策文档标注

概述

block_core_file_ensure_interactivity_dependency() 是一个已弃用的 WordPress 函数,用于确保视图脚本具有 wp-interactivity 依赖。自 WordPress 6.5.0 起,建议使用 wp_register_script_module 替代。

关键要点

  • 函数 block_core_file_ensure_interactivity_dependency() 在 WordPress 6.5.0 中被弃用,替代方案是 wp_register_script_module。
  • 该函数最初在 WordPress 6.4.0 中引入,用于处理视图脚本的交互性依赖。
  • 开发者应更新代码以避免使用此弃用函数,以保持兼容性和最佳实践。

📄 原文内容

Ensure that the view script has the wp-interactivity dependency.

Source

function block_core_file_ensure_interactivity_dependency() {
	_deprecated_function( __FUNCTION__, '6.5.0', 'wp_register_script_module' );
}

Changelog

Version Description
6.5.0 Deprecated.
6.4.0 Introduced.