Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Color Picker Example #40

Closed
bueltge opened this issue Jul 14, 2016 · 1 comment
Closed

Add Color Picker Example #40

bueltge opened this issue Jul 14, 2016 · 1 comment
Labels

Comments

@bueltge
Copy link
Owner

bueltge commented Jul 14, 2016

add_action( 'admin_enqueue_scripts', 'mw_enqueue_color_picker' );
function mw_enqueue_color_picker( $hook_suffix ) {
    // first check that $hook_suffix is appropriate for your admin page
    wp_enqueue_style( 'wp-color-picker' );
    wp_enqueue_script( 'my-script-handle', plugins_url('my-script.js', __FILE__ ), array( 'wp-color-picker' ), false, true );
}
<input type="text" value="#bada55" class="my-color-field" data-default-color="#effeff" />
jQuery(document).ready(function($){
    $('.my-color-field').wpColorPicker();
});

Since WP 3.5
https://make.wordpress.org/core/2012/11/30/new-color-picker-in-wp-3-5/

@bueltge bueltge added this to the 1.5.0 milestone Jul 14, 2016
@bueltge bueltge removed this from the 1.5.0 milestone Nov 15, 2019
@bueltge
Copy link
Owner Author

bueltge commented Apr 28, 2021

Include via c4bdf61

@bueltge bueltge closed this as completed Apr 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant