How to Use WordPress Color Picker API in Custom Post Type Metabox
I’ve created a metabox once with color picker. You need to include color picker style and script in your admin_enqueue_scripts hook, and then initialize it with $(‘.color-picker’).wpColorPicker(); From my gist: <?php add_action( ‘admin_enqueue_scripts’, ‘mytheme_backend_scripts’); if ( ! function_exists( ‘mytheme_backend_scripts’ ) ){ function mytheme_backend_scripts($hook) { wp_enqueue_media(); wp_enqueue_style( ‘wp-color-picker’); wp_enqueue_script( ‘wp-color-picker’); } } add_action( ‘add_meta_boxes’, ‘mytheme_add_meta_box’ ); … Read more