wp_theme_json_data_blocks
Filter HookDescription
Filters the data provided by the blocks for global styles & settings.Hook Information
File Location |
wp-includes/class-wp-theme-json-resolver.php
View on GitHub
|
Hook Type | Filter |
Line Number | 425 |
Hook Parameters
Type | Name | Description |
---|---|---|
WP_Theme_JSON_Data
|
$theme_json
|
Class to access and update the underlying data. |
Usage Examples
Basic Usage
<?php
// Hook into wp_theme_json_data_blocks
add_filter('wp_theme_json_data_blocks', 'my_custom_filter', 10, 1);
function my_custom_filter($theme_json) {
// Your custom filtering logic here
return $theme_json;
}
Source Code Context
wp-includes/class-wp-theme-json-resolver.php:425
- How this hook is used in WordPress core
<?php
420 *
421 * @since 6.1.0
422 *
423 * @param WP_Theme_JSON_Data $theme_json Class to access and update the underlying data.
424 */
425 $theme_json = apply_filters( 'wp_theme_json_data_blocks', new WP_Theme_JSON_Data( $config, 'blocks' ) );
426
427 /*
428 * Backward compatibility for extenders returning a WP_Theme_JSON_Data
429 * compatible class that is not a WP_Theme_JSON_Data object.
430 */
PHP Documentation
<?php
/**
* Filters the data provided by the blocks for global styles & settings.
*
* @since 6.1.0
*
* @param WP_Theme_JSON_Data $theme_json Class to access and update the underlying data.
*/
Quick Info
- Hook Type: Filter
- Parameters: 1
- File: wp-includes/class-wp-theme-json-resolver.php
Related Hooks
Related hooks will be displayed here in future updates.