Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Add colours to ACF colour picker
function themeprefix_acf_input_admin_footer() {
?>
<script type="text/javascript">
(function($) {
acf.add_filter('color_picker_args', function( args, $field ){
// add the hexadecimal codes here for the colors you want to appear as swatches
args.palettes = ['#F0F4F9', '#FFFBC5']
// return colors
return args;
});
})(jQuery);
</script>
<?php
}
add_action('acf/input/admin_footer', 'themeprefix_acf_input_admin_footer');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.