Changeset 52232 for trunk/src/wp-includes/class-wp-theme-json-resolver.php
- Timestamp:
- 11/23/2021 05:38:45 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-theme-json-resolver.php
r52181 r52232 137 137 $config = self::read_json_file( __DIR__ . '/theme.json' ); 138 138 $config = self::translate( $config ); 139 self::$core = new WP_Theme_JSON( $config, ' core' );139 self::$core = new WP_Theme_JSON( $config, 'default' ); 140 140 141 141 return self::$core; … … 183 183 * and merge the self::$theme upon that. 184 184 */ 185 $theme_support_data = WP_Theme_JSON::get_from_editor_settings( get_default_block_editor_settings() ); 185 $theme_support_data = WP_Theme_JSON::get_from_editor_settings( get_default_block_editor_settings() ); 186 if ( ! self::theme_has_support() ) { 187 if ( ! isset( $theme_support_data['settings']['color'] ) ) { 188 $theme_support_data['settings']['color'] = array(); 189 } 190 191 $default_palette = false; 192 if ( current_theme_supports( 'default-color-palette' ) ) { 193 $default_palette = true; 194 } 195 if ( ! isset( $theme_support_data['settings']['color']['palette'] ) ) { 196 // If the theme does not have any palette, we still want to show the core one. 197 $default_palette = true; 198 } 199 $theme_support_data['settings']['color']['defaultPalette'] = $default_palette; 200 201 $default_gradients = false; 202 if ( current_theme_supports( 'default-gradient-presets' ) ) { 203 $default_gradients = true; 204 } 205 if ( ! isset( $theme_support_data['settings']['color']['gradients'] ) ) { 206 // If the theme does not have any gradients, we still want to show the core ones. 207 $default_gradients = true; 208 } 209 $theme_support_data['settings']['color']['defaultGradients'] = $default_gradients; 210 } 186 211 $with_theme_supports = new WP_Theme_JSON( $theme_support_data ); 187 212 $with_theme_supports->merge( self::$theme ); … … 294 319 /** 295 320 * There are three sources of data (origins) for a site: 296 * core, theme, and user. The user's has higher priority321 * default, theme, and user. The user's has higher priority 297 322 * than the theme's, and the theme's higher than core's. 298 323 *
Note: See TracChangeset
for help on using the changeset viewer.