wp_theme_json_get_style_nodes
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-includes/class-wp-theme-json.php 2702
return apply_filters( 'wp_theme_json_get_style_nodes', $nodes );
Где используется хук в WordPress
wp-includes/block-supports/block-style-variations.php 159
remove_filter( 'wp_theme_json_get_style_nodes', 'wp_filter_out_block_nodes' );
wp-includes/block-supports/block-style-variations.php 182
add_filter( 'wp_theme_json_get_style_nodes', 'wp_filter_out_block_nodes' );
wp-includes/script-loader.php 2594
add_filter( 'wp_theme_json_get_style_nodes', 'wp_filter_out_block_nodes' );