Skip to content

Instantly share code, notes, and snippets.

@vanaf1979
Last active April 1, 2020 12:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vanaf1979/12a2622908fb551ae80f41b8e42d60d5 to your computer and use it in GitHub Desktop.
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/
<?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