wp_filter_out_block_nodes
函数
wp_filter_out_block_nodes ( $nodes )
- 参数
-
-
(array)
$nodes
The nodes to filter.- Required: 是
-
(array)
- 返回值
-
- (array) A filtered array of style nodes.
- 定义位置
-
-
wp-includes/script-loader.php
, line 2393
-
wp-includes/script-loader.php
- 引入
- 6.1.0
- 弃用
- –
Applies a filter to the list of style nodes that comes from WP_Theme_JSON::get_style_nodes().
This particular filter removes all of the blocks from the array.
We want WP_Theme_JSON to be ignorant of the implementation details of how the CSS is being used.
This filter allows us to modify the output of WP_Theme_JSON depending on whether or not we are
loading separate assets, without making the class aware of that detail.
function wp_filter_out_block_nodes( $nodes ) { return array_filter( $nodes, function( $node ) { return ! in_array( 'blocks', $node['path'], true ); }, ARRAY_FILTER_USE_BOTH ); }
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。