wp_theme_json_get_style_nodes хук-фильтрWP 6.1.0

Filters the list of style nodes with metadata.

This allows for things like loading block CSS independently.

Использование

add_filter( 'wp_theme_json_get_style_nodes', 'wp_kama_theme_json_get_style_nodes_filter' );

/**
 * Function for `wp_theme_json_get_style_nodes` filter-hook.
 * 
 * @param array $nodes Style nodes with metadata.
 *
 * @return array
 */
function wp_kama_theme_json_get_style_nodes_filter( $nodes ){

	// filter...
	return $nodes;
}
$nodes(массив)
Style nodes with metadata.

Список изменений

С версии 6.1.0 Введена.

Где вызывается хук

WP_Theme_JSON::get_style_nodes()
wp_theme_json_get_style_nodes
wp-includes/class-wp-theme-json.php 2319
return apply_filters( 'wp_theme_json_get_style_nodes', $nodes );

Где используется хук в WordPress

wp-includes/script-loader.php 2505
add_filter( 'wp_theme_json_get_style_nodes', 'wp_filter_out_block_nodes' );