Color Palette Plugin
-
I am new to plugin development. I’m trying to create a color palette plugin. The code I wrote is supposed to overwrite the gutenburg color palette settings. However, the code only partly works. It was able to disable the color picker but it didn’t disable the color palette. The plugin is supposed to work for every theme and I was using Twenty Twenty wp theme as a practice theme to work in.
Here’s my code that’s supposed to disable the gutenburg color settings. It’s inplugin.phpin thepractice color paletteplugin<?php /** * Plugin Name: Practice Color Palette Plugin * Description: This is a plugin to practice * Version: 1.0.0 * Author: Kiki * */ if( ! defined( 'ABSPATH' ) ) { exit; } function wpdc_disable_gutenberg_color_settings() { add_theme_support( 'disable-custom-colors' ); 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' );
I don’t know why some parts weren’t working. I need help.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Color Palette Plugin’ is closed to new replies.