Change Advanced Custom Field’s Color Picker Color Swatch

June 14, 2021

When working with Advanced Custom Field’s Color Picker field, you’ll often want to change the color options available to the editor.  After all, you are customizing the fields for a content creator.  Making the color swatch something custom will often allow for quick access and avoid constantly copying HEX codes.

Below is the code snippet you can place in your theme’s  functions.php  file.  Customize as needed!

Adding this to your theme will switch out the color swatch initialized by Advanced Custom Field’s color picker field.  The example above will cover 1 row (8 per row), but you can add up to 48!

Bonus Tip: Change the Font Text Color Swatch for WYSIWYG Editor

Since you’ve customized the color swatch for a color picker field in your editor, wouldn’t it be great to customized the text colors available to your content editor, as well?

Below is a code snippet to place in your theme’s functions.php  to change the color swatch available for the text colors:

This is just another feature to help your editor’s experience when editing their site!

Hope this helps! Happy coding!

Leave a Reply

Your email address will not be published. Required fields are marked *