Changeset 54251
- Timestamp:
- 09/20/2022 01:10:28 PM (2 years ago)
- Location:
- trunk/src
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-theme-json-resolver.php
r54246 r54251 138 138 $config = static::read_json_file( __DIR__ . '/theme.json' ); 139 139 $config = static::translate( $config ); 140 /** 141 * Filters the default data provided by WordPress for global styles & settings. 142 * 143 * @since 6.1.0 144 * 145 * @param WP_Theme_JSON_Data Class to access and update the underlying data. 146 */ 147 $theme_json = apply_filters( 'theme_json_default', new WP_Theme_JSON_Data( $config, 'default' ) ); 148 $config = $theme_json->get_data(); 140 149 static::$core = new WP_Theme_JSON( $config, 'default' ); 141 150 … … 173 182 $theme_json_data = static::read_json_file( static::get_file_path_from_theme( 'theme.json' ) ); 174 183 $theme_json_data = static::translate( $theme_json_data, wp_get_theme()->get( 'TextDomain' ) ); 184 /** 185 * Filters the data provided by the theme for global styles & settings. 186 * 187 * @since 6.1.0 188 * 189 * @param WP_Theme_JSON_Data Class to access and update the underlying data. 190 */ 191 $theme_json = apply_filters( 'theme_json_theme', new WP_Theme_JSON_Data( $theme_json_data, 'theme' ) ); 192 $theme_json_data = $theme_json->get_data(); 175 193 static::$theme = new WP_Theme_JSON( $theme_json_data ); 176 194 … … 258 276 } 259 277 } 278 279 /** 280 * Filters the data provided by the blocks for global styles & settings. 281 * 282 * @since 6.1.0 283 * 284 * @param WP_Theme_JSON_Data Class to access and update the underlying data. 285 */ 286 $theme_json = apply_filters( 'theme_json_blocks', new WP_Theme_JSON_Data( $config, 'core' ) ); 287 $config = $theme_json->get_data(); 260 288 261 289 // Core here means it's the lower level part of the styles chain. … … 383 411 if ( JSON_ERROR_NONE !== $json_decoding_error ) { 384 412 trigger_error( 'Error when decoding a theme.json schema for user data. ' . json_last_error_msg() ); 413 /** 414 * Filters the data provided by the user for global styles & settings. 415 * 416 * @since 6.1.0 417 * 418 * @param WP_Theme_JSON_Data Class to access and update the underlying data. 419 */ 420 $theme_json = apply_filters( 'theme_json_user', new WP_Theme_JSON_Data( $config, 'custom' ) ); 421 $config = $theme_json->get_data(); 385 422 return new WP_Theme_JSON( $config, 'custom' ); 386 423 } … … 397 434 } 398 435 } 436 437 /** 438 * Filters the data provided by the user for global styles & settings. 439 * 440 * @since 6.1.0 441 * 442 * @param WP_Theme_JSON_Data Class to access and update the underlying data. 443 */ 444 $theme_json = apply_filters( 'theme_json_user', new WP_Theme_JSON_Data( $config, 'custom' ) ); 445 $config = $theme_json->get_data(); 399 446 static::$user = new WP_Theme_JSON( $config, 'custom' ); 400 447 -
trunk/src/wp-settings.php
r54156 r54251 173 173 require ABSPATH . WPINC . '/class-wp-theme.php'; 174 174 require ABSPATH . WPINC . '/class-wp-theme-json-schema.php'; 175 require ABSPATH . WPINC . '/class-wp-theme-json-data.php'; 175 176 require ABSPATH . WPINC . '/class-wp-theme-json.php'; 176 177 require ABSPATH . WPINC . '/class-wp-theme-json-resolver.php';
Note: See TracChangeset
for help on using the changeset viewer.