Last active
April 1, 2020 12:19
-
-
Save vanaf1979/12a2622908fb551ae80f41b8e42d60d5 to your computer and use it in GitHub Desktop.
Snippet #011 Custom Gutenberg gradient colors. https://since1979.dev/snippet-011-custom-gutenberg-gradient-colors/
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
<?php | |
/** | |
* disable_editor_gradients. | |
* | |
* Disable gradient coors in the gutenberg editor. | |
* | |
* @see https://since1979.dev/snippet-011-custom-gutenberg-gradient-colors/ | |
* | |
* @uses add_theme_support() https://developer.wordpress.org/reference/functions/add_theme_support/ | |
* @uses array() https://www.php.net/manual/en/function.array.php | |
*/ | |
function disable_editor_gradients() | |
{ | |
add_theme_support('disable-custom-gradients'); | |
add_theme_support('editor-gradient-presets', array()); | |
} | |
/** | |
* Hook: after_setup_theme. | |
* | |
* @uses add_action() https://developer.wordpress.org/reference/functions/add_action/ | |
* @uses after_setup_theme https://developer.wordpress.org/reference/hooks/after_setup_theme/ | |
*/ | |
add_action('after_setup_theme', 'disable_editor_gradients'); | |
?> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment