Created
February 2, 2017 15:24
-
-
Save BHWD/94655366c6061d2761d99af17cc56438 to your computer and use it in GitHub Desktop.
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
function my_acf_admin_head() { | |
echo "<script> | |
(function($){ | |
acf.add_action('ready append', function() { | |
acf.get_fields({ type : 'color_picker'}).each(function() { | |
$(this).iris({ | |
palettes: ['#111111', '#333333', '#555555', '#777777', '#999999', '#cccccc'], | |
change: function(event, ui) { | |
$(this).parents('.wp-picker-container').find('.wp-color-result').css('background-color', ui.color.toString()); | |
} | |
}); | |
}); | |
}); | |
})(jQuery); | |
</script>"; | |
} | |
add_action( 'acf/input/admin_head', 'my_acf_admin_head' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment