Created
October 23, 2017 16:21
-
-
Save simplethemes/d3ec21c46a8ae16edff2332d97c85b8e to your computer and use it in GitHub Desktop.
Customize the ACF color picker in your theme
This file contains hidden or 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
// add brand color palette to acf color picker | |
function kronos_acf_input_admin_footer() { | |
?><script type="text/javascript"> | |
(function($) { | |
acf.add_filter('color_picker_args', function( args, $field ){ | |
args.palettes = ["#000000","#CCCCCC","#EEEEEE","#FFFFFF","#b9ad33","#4c92af","#79c0a6"] | |
return args; | |
}); | |
})(jQuery); | |
</script> | |
<?php } | |
add_action('acf/input/admin_footer', 'kronos_acf_input_admin_footer'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment