Advertisement
Guest User

Untitled

a guest
Feb 11th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. if(is_admin()){
  2. // Add the color picker css file
  3. wp_enqueue_style( 'wp-color-picker' );
  4. wp_enqueue_script( 'wp-color-picker' );
  5.  
  6. var myOptions = {
  7. // you can declare a default color here,
  8. // or in the data-default-color attribute on the input
  9. defaultColor: '#000',
  10. // a callback to fire whenever the color changes to a valid color
  11. change: function(event, ui){
  12.  
  13. },
  14. // a callback to fire when the input is emptied or an invalid color
  15. clear: function() {},
  16. // hide the color picker controls on load
  17. hide: true,
  18. // show a group of common colors beneath the square
  19. // or, supply an array of colors to customize further
  20. palettes: true
  21. };
  22.  
  23. // Add Color Picker to all inputs that have 'color-field' class
  24. $('.color-field').wpColorPicker(myOptions);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement