wp.data.select("core").__experimentalGetCurrentThemeBaseGlobalStyles();
Last active
July 25, 2023 03:21
-
-
Save mintbird/c449fbde002891129746afdb70d836eb to your computer and use it in GitHub Desktop.
WordPress / Gutenberg Snippets
WP_Theme_JSON_Resolver::get_theme_data();
function filter_theme_json_theme( $theme_json ){
$new_data = array(
'version' => 2,
'settings' => array(
'color' => array(
'text' => false,
'palette' => array( /* New palette */
array(
'slug' => 'base',
'color' => 'white',
'name' => __( 'Base', 'theme-domain' ),
),
array(
'slug' => 'contrast',
'color' => 'black',
'name' => __( 'Contrast', 'theme-domain' ),
),
),
),
),
);
return $theme_json->update_with( $new_data );
}
add_filter( 'wp_theme_json_data_theme', 'filter_theme_json_theme' );
WP_Theme_JSON_Resolver::get_style_variations()
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment