wp_theme_json_get_style_nodes filter-hookWP 6.1.0

Filters the list of style nodes with metadata.

This allows for things like loading block CSS independently.

Usage

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(array)
Style nodes with metadata.

Changelog

Since 6.1.0 Introduced.

Where the hook is called

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

Where the hook is used in WordPress

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