WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
This hook occurs 2 times in this file.
Line | Code |
---|---|
488 | if ( JSON_ERROR_NONE !== $json_decoding_error ) { |
489 | trigger_error( 'Error when decoding a theme.json schema for user data. ' . json_last_error_msg() ); |
490 | /** |
491 | * Filters the data provided by the user for global styles & settings. |
492 | * |
493 | * @since 6.1.0 |
494 | * |
495 | * @param WP_Theme_JSON_Data Class to access and update the underlying data. |
496 | */ |
497 | $theme_json = apply_filters( 'wp_theme_json_data_user', new WP_Theme_JSON_Data( $config, 'custom' ) ); |
498 | $config = $theme_json->get_data(); |
499 | return new WP_Theme_JSON( $config, 'custom' ); |
500 | } |
501 |
|
502 | // Very important to verify that the flag isGlobalStylesUserThemeJSON is true. |
503 | // If it's not true then the content was not escaped and is not safe. |
504 | if ( |
505 | is_array( $decoded_data ) && |
506 | isset( $decoded_data['isGlobalStylesUserThemeJSON'] ) && |
507 | $decoded_data['isGlobalStylesUserThemeJSON'] |
508 | ) { |
509 | unset( $decoded_data['isGlobalStylesUserThemeJSON'] ); |
510 | $config = $decoded_data; |
511 | } |
512 | } |
513 |
|
514 | /** This filter is documented in wp-includes/class-wp-theme-json-resolver.php */ |
515 | $theme_json = apply_filters( 'wp_theme_json_data_user', new WP_Theme_JSON_Data( $config, 'custom' ) ); |
516 | $config = $theme_json->get_data(); |
517 | static::$user = new WP_Theme_JSON( $config, 'custom' ); |
518 |
|
519 | return static::$user; |
520 | } |
521 |
|
522 | /** |
523 | * Returns the data merged from multiple origins. |
524 | * |