Make WordPress Core


Ignore:
Timestamp:
11/08/2021 07:18:39 PM (2 years ago)
Author:
jorgefilipecosta
Message:

Update theme.json classes for WordPress 5.9.

This commit ports to core the changes to the classes that deal with theme.json code.

See #54336.
Props oandregal, spacedmonkey, noisysocks, hellofromtonya, youknowriad.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/block-editor.php

    r52042 r52049  
    304304    );
    305305
    306     $theme_json = WP_Theme_JSON_Resolver::get_merged_data( $editor_settings );
     306    $theme_json = WP_Theme_JSON_Resolver::get_merged_data();
    307307
    308308    if ( WP_Theme_JSON_Resolver::theme_has_support() ) {
    309309        $editor_settings['styles'][] = array(
    310             'css'            => $theme_json->get_stylesheet( 'block_styles' ),
     310            'css'            => $theme_json->get_stylesheet( array( 'styles', 'presets' ) ),
    311311            '__unstableType' => 'globalStyles',
    312312        );
    313313        $editor_settings['styles'][] = array(
    314             'css'                     => $theme_json->get_stylesheet( 'css_variables' ),
     314            'css'                     => $theme_json->get_stylesheet( array( 'variables' ) ),
    315315            '__experimentalNoWrapper' => true,
    316316            '__unstableType'          => 'globalStyles',
     
    359359        unset( $editor_settings['__experimentalFeatures']['typography']['customFontSize'] );
    360360    }
    361     if ( isset( $editor_settings['__experimentalFeatures']['typography']['customLineHeight'] ) ) {
    362         $editor_settings['enableCustomLineHeight'] = $editor_settings['__experimentalFeatures']['typography']['customLineHeight'];
    363         unset( $editor_settings['__experimentalFeatures']['typography']['customLineHeight'] );
     361    if ( isset( $editor_settings['__experimentalFeatures']['typography']['lineHeight'] ) ) {
     362        $editor_settings['enableCustomLineHeight'] = $editor_settings['__experimentalFeatures']['typography']['lineHeight'];
     363        unset( $editor_settings['__experimentalFeatures']['typography']['lineHeight'] );
    364364    }
    365365    if ( isset( $editor_settings['__experimentalFeatures']['spacing']['units'] ) ) {
     
    367367        unset( $editor_settings['__experimentalFeatures']['spacing']['units'] );
    368368    }
    369     if ( isset( $editor_settings['__experimentalFeatures']['spacing']['customPadding'] ) ) {
    370         $editor_settings['enableCustomSpacing'] = $editor_settings['__experimentalFeatures']['spacing']['customPadding'];
    371         unset( $editor_settings['__experimentalFeatures']['spacing']['customPadding'] );
     369    if ( isset( $editor_settings['__experimentalFeatures']['spacing']['padding'] ) ) {
     370        $editor_settings['enableCustomSpacing'] = $editor_settings['__experimentalFeatures']['spacing']['padding'];
     371        unset( $editor_settings['__experimentalFeatures']['spacing']['padding'] );
    372372    }
    373373
Note: See TracChangeset for help on using the changeset viewer.