Created
March 8, 2022 18:00
-
-
Save jonschr/b7802d145c34000063ce36cbd7bfcbbb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// get the palette from the theme defaults, as defined in theme.json | |
$color_palette = []; | |
if ( class_exists( 'WP_Theme_JSON_Resolver' ) ) { | |
$settings = WP_Theme_JSON_Resolver::get_theme_data()->get_settings(); | |
if ( isset( $settings['color']['palette']['theme'] ) ) { | |
$color_palette = $settings['color']['palette']['theme']; | |
} | |
} | |
// do stuff with $color_palette |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment