函数文档

wp_interactivity_process_directives_of_interactive_blocks()

💡 云策文档标注

概述

此函数用于处理交互式块渲染后HTML中的指令,但已从WordPress 6.6.0版本起被弃用。它每次仅处理一个根交互式块,忽略其内部所有交互式子块。

关键要点

  • 函数 wp_interactivity_process_directives_of_interactive_blocks() 已弃用,不建议在新代码中使用。
  • 它接受一个数组参数 $parsed_block,表示已解析的块,并返回相同的数组。
  • 处理逻辑专注于根交互式块,不处理其内部的交互式子块。

代码示例

function wp_interactivity_process_directives_of_interactive_blocks( array $parsed_block ): array {
    _deprecated_function( __FUNCTION__, '6.6.0' );
    return $parsed_block;
}

注意事项

  • 此函数自WordPress 6.6.0起被弃用,开发者应避免使用并寻找替代方案。
  • 相关函数 _deprecated_function() 用于标记弃用并通知使用情况。
  • 版本历史:6.5.0引入,6.6.0弃用。

📄 原文内容

Processes the directives on the rendered HTML of the interactive blocks.

Description

This processes only one root interactive block at a time because the rendered HTML of that block contains the rendered HTML of all its inner blocks, including any interactive block. It does so by ignoring all the interactive inner blocks until the root interactive block is processed.

Parameters

$parsed_blockarrayrequired
The parsed block.

Return

array The same parsed block.

Source

function wp_interactivity_process_directives_of_interactive_blocks( array $parsed_block ): array {
	_deprecated_function( __FUNCTION__, '6.6.0' );
	return $parsed_block;
}

Changelog

Version Description
6.6.0 Deprecated.
6.5.0 Introduced.