钩子文档

wp_theme_json_get_style_nodes

💡 云策文档标注

概述

wp_theme_json_get_style_nodes 是一个 WordPress 过滤器,用于过滤带有元数据的样式节点列表。它允许独立加载块 CSS 等功能。

关键要点

  • 过滤器名称:wp_theme_json_get_style_nodes
  • 参数:$nodes(数组,包含元数据的样式节点)
  • 用途:修改或扩展 WP_Theme_JSON::get_style_nodes() 方法返回的样式节点元数据
  • 引入版本:WordPress 6.1.0

📄 原文内容

Filters the list of style nodes with metadata.

Description

This allows for things like loading block CSS independently.

Parameters

$nodesarray
Style nodes with metadata.

Source

return apply_filters( 'wp_theme_json_get_style_nodes', $nodes );

Changelog

Version Description
6.1.0 Introduced.