Changeset 58339 for trunk/src/wp-includes/class-wp-theme-json.php
- Timestamp:
- 06/05/2024 08:11:03 AM (11 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-theme-json.php
r58328 r58339 3525 3525 // Deprecated theme supports. 3526 3526 if ( isset( $settings['disableCustomColors'] ) ) { 3527 if ( ! isset( $theme_settings['settings']['color'] ) ) {3528 $theme_settings['settings']['color'] = array();3529 }3530 3527 $theme_settings['settings']['color']['custom'] = ! $settings['disableCustomColors']; 3531 3528 } 3532 3529 3533 3530 if ( isset( $settings['disableCustomGradients'] ) ) { 3534 if ( ! isset( $theme_settings['settings']['color'] ) ) {3535 $theme_settings['settings']['color'] = array();3536 }3537 3531 $theme_settings['settings']['color']['customGradient'] = ! $settings['disableCustomGradients']; 3538 3532 } 3539 3533 3540 3534 if ( isset( $settings['disableCustomFontSizes'] ) ) { 3541 if ( ! isset( $theme_settings['settings']['typography'] ) ) {3542 $theme_settings['settings']['typography'] = array();3543 }3544 3535 $theme_settings['settings']['typography']['customFontSize'] = ! $settings['disableCustomFontSizes']; 3545 3536 } 3546 3537 3547 3538 if ( isset( $settings['enableCustomLineHeight'] ) ) { 3548 if ( ! isset( $theme_settings['settings']['typography'] ) ) {3549 $theme_settings['settings']['typography'] = array();3550 }3551 3539 $theme_settings['settings']['typography']['lineHeight'] = $settings['enableCustomLineHeight']; 3552 3540 } 3553 3541 3554 3542 if ( isset( $settings['enableCustomUnits'] ) ) { 3555 if ( ! isset( $theme_settings['settings']['spacing'] ) ) {3556 $theme_settings['settings']['spacing'] = array();3557 }3558 3543 $theme_settings['settings']['spacing']['units'] = ( true === $settings['enableCustomUnits'] ) ? 3559 3544 array( 'px', 'em', 'rem', 'vh', 'vw', '%' ) : … … 3562 3547 3563 3548 if ( isset( $settings['colors'] ) ) { 3564 if ( ! isset( $theme_settings['settings']['color'] ) ) {3565 $theme_settings['settings']['color'] = array();3566 }3567 3549 $theme_settings['settings']['color']['palette'] = $settings['colors']; 3568 3550 } 3569 3551 3570 3552 if ( isset( $settings['gradients'] ) ) { 3571 if ( ! isset( $theme_settings['settings']['color'] ) ) {3572 $theme_settings['settings']['color'] = array();3573 }3574 3553 $theme_settings['settings']['color']['gradients'] = $settings['gradients']; 3575 3554 } … … 3583 3562 } 3584 3563 } 3585 if ( ! isset( $theme_settings['settings']['typography'] ) ) {3586 $theme_settings['settings']['typography'] = array();3587 }3588 3564 $theme_settings['settings']['typography']['fontSizes'] = $font_sizes; 3589 3565 } 3590 3566 3591 3567 if ( isset( $settings['enableCustomSpacing'] ) ) { 3592 if ( ! isset( $theme_settings['settings']['spacing'] ) ) {3593 $theme_settings['settings']['spacing'] = array();3594 }3595 3568 $theme_settings['settings']['spacing']['padding'] = $settings['enableCustomSpacing']; 3596 3569 } 3597 3570 3598 3571 if ( isset( $settings['spacingSizes'] ) ) { 3599 if ( ! isset( $theme_settings['settings']['spacing'] ) ) {3600 $theme_settings['settings']['spacing'] = array();3601 }3602 3572 $theme_settings['settings']['spacing']['spacingSizes'] = $settings['spacingSizes']; 3603 3573 } … … 3776 3746 * 3777 3747 * @since 6.1.0 3778 * @deprecated 6.6.0 3779 * 3780 * @param string $origin Optional. What source of data to set the spacing sizes for. 3781 * One of 'default', 'theme', or 'custom'. Default 'default'. 3748 * @deprecated 6.6.0 No longer used as the spacingSizes are automatically 3749 * generated in the constructor and merge methods instead 3750 * of manually after instantiation. 3782 3751 * 3783 3752 * @return null|void
Note: See TracChangeset
for help on using the changeset viewer.