Make WordPress Core


Ignore:
Timestamp:
01/09/2024 11:30:10 PM (16 months ago)
Author:
isabel_brison
Message:

Editor: output palette presets when appearance tools or border are enabled.

Adds color palette presets to global styles output if current theme supports either appearance tools or border.

Props andrewserong, noisysocks.
Fixes #60134.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/global-styles-and-settings.php

    r56457 r57259  
    223223         */
    224224        $origins = array( 'default', 'theme', 'custom' );
    225         if ( ! $supports_theme_json ) {
     225        /*
     226        * If the theme doesn't have theme.json but supports both appearance tools and color palette,
     227        * the 'theme' origin should be included so color palette presets are also output.
     228        */
     229        if ( ! $supports_theme_json && ( current_theme_supports( 'appearance-tools' ) || current_theme_supports( 'border' ) ) && current_theme_supports( 'editor-color-palette' ) ) {
     230            $origins = array( 'default', 'theme' );
     231        } elseif ( ! $supports_theme_json ) {
    226232            $origins = array( 'default' );
    227233        }
Note: See TracChangeset for help on using the changeset viewer.