wp_theme_json_get_style_nodes
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-includes/class-wp-theme-json.php 2655
return apply_filters( 'wp_theme_json_get_style_nodes', $nodes );
Where the hook is used in WordPress
wp-includes/block-supports/block-style-variations.php 154
remove_filter( 'wp_theme_json_get_style_nodes', 'wp_filter_out_block_nodes' );
wp-includes/block-supports/block-style-variations.php 177
add_filter( 'wp_theme_json_get_style_nodes', 'wp_filter_out_block_nodes' );
wp-includes/script-loader.php 2554
add_filter( 'wp_theme_json_get_style_nodes', 'wp_filter_out_block_nodes' );