In the same way that there is an option add_theme_support('disable-custom-colors');.
Related: #18171 #17774
It looks like this was added as an experimental feature only very recently:
https://github.com/WordPress/gutenberg/commit/5e68cdce7c8ed4c5fb831c4ccd89ade97524f073#diff-bda1f53deac273d361a56c63a5b90adeR157
@jorgefilipecosta Any further info the reporter should be aware of for this issue?
Hi @markhowellsmead, as @talldan referred this feature is now available in an experimental state.
It is possible to completely disable gradients using:
add_theme_support(聽'__experimental-editor-gradient-presets',聽array() );
add_theme_support(聽'__experimental-disable-custom-gradients',聽true );
.
Thank you for reporting this issue!
Great! Thanks @jorgefilipecosta!
For anyone wondering why the above snippet no longer works. It's been changed to:
add_theme_support('editor-gradient-presets', []);
add_theme_support('disable-custom-gradients', true);
Not sure when that happened, but removing the __experimental- prefix works for me using WordPress 5.4
Hi @Ahrengot, thank you for sharing the new code, since the original discussion the APIs were stabilized and now the experimental prefix should not be used.
Most helpful comment
For anyone wondering why the above snippet no longer works. It's been changed to:
Not sure when that happened, but removing the
__experimental-prefix works for me using WordPress 5.4