替換區塊編輯器預設顏色組

function wpdc_disable_gutenberg_color_settings() {
// add_theme_support( 'disable-custom-colors' );
add_theme_support( 'editor-color-palette' );
add_theme_support( 'editor-gradient-presets', [] );
add_theme_support( 'disable-custom-gradients' );
}
add_action( 'after_setup_theme', 'wpdc_disable_gutenberg_color_settings' );
function wpdc_add_custom_gutenberg_color_palette() {
add_theme_support(
'editor-color-palette',
[
[ 'color' => '色碼一', ],
[ 'color' => '色碼二', ],
]
);
}
add_action( 'after_setup_theme', 'wpdc_add_custom_gutenberg_color_palette' );