Hey guys,
I use wordpress on most of my client's site, and I recently had the idea to alter the palette below the Iris color picker to match my client's color scheme. Make it quicker for me and easier for them.
I did some digging and found this site. It basically just said to paste this in my functions.php:
// customise palette colours
function firefly_customize_controls_print_footer_scripts() {
?>
<script>
jQuery(document).ready(function($){
$.wp.wpColorPicker.prototype.options = {
palettes: ['#ffffff', '#000000','#ff0000']
};
});
</script>
<?php
}
add_action('customize_controls_print_footer_scripts', 'firefly_customize_controls_print_footer_scripts');
Makes sense in theory, but I'm having the hardest time getting it to work. The script is definitely running. In my troubleshooting I put an alert in the script and it most definitely fired.
Any idea what I'm missing? I checked some color pickers on a few different pages, including one for my theme's built in settings and some in the theme customization page.
I'm pretty strong with php & css, and have been dabbling in javascript/jQuery for a while now, so I'm comfortable but not fluent with it.
Any ideas you all have would be greatly appreciated.