Yes, there is: https://make.wordpress.org/core/2012/11/30/new-color-picker-in-wp-3-5/
1. You should enqueue scripts and styles…
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 );
}
2. … add an input…
<input type="text" value="#bada55" class="my-color-field" data-default-color="#effeff" />
3. … and call wpColorPicker function
jQuery(document).ready(function($){
$('.my-color-field').wpColorPicker();
});
Related Posts:
- Is it possible to reuse wp.media.editor Modal for dialogs other than media
- How can I run AJAX on a button click event?
- Add async script
- How to provide translations for a WordPress TinyMCE plugin?
- How-to implement admin Ajax inside an admin WP_List_Table?
- API to trigger prompt on leaving page
- Include third party Javascript library which is not included in WordPress
- Hook the Keydown Event in the TinyMCE Post Editor
- How to Add a .js file Only in one specific Page Dynamically to Head
- wp_localize_script $handle
- How to Use WordPress Color Picker API in Custom Post Type Metabox
- How to prevent loading of all plugin’s resources?
- How to trap “Publish” button to check for meta box validation?
- Pass javascript result to shortcode executer function
- The changes I make to an external JS file of my WP plugin are only applied after I clear my browser’s cache
- `wp_set_script_translations` with `wp.i18n` does not return translated strings in simple plugin
- Use js script from one plugin in another plugin
- creating elements/innerblocks via rangecontrol
- Making a custom widget that includes a tinymce and works in Site Origin Page Builder
- Looking for callback function after Gutenberg is rendered?
- What’s the better way to add an inline script?
- Can’t get JS code to work with shortcode
- How do I add a javascript file to all admin pages via a plugin?
- Gutenberg: useDispatch is not a function – @wordpress/data included
- Make a list with header and subtext in Gutenberg blocks
- Gutenberg – What is the best way to save/update post meta?
- Prevent Javascript Facebook SDK Conflicts in plugin
- wpColorPicker is not a function!
- how to include javascript file and css file in wordpress
- Print WordPress username id inside JavaScript
- Mixing Regular Javascript With jQuery in a Plugin
- How to run a external JavaScript file on wp-admin if admin, and other if normal user?
- Why is my javascript not invoked in my hooks except wp_head?
- Where to call wp_enqueue_script in a plugin with custom template?
- Is there an event or an other method that tells me the preview is loaded?
- WordPress Plugin with a shortcode that dynamically generates javascript. Can I use add_action without wrapping the javascript in a function?
- How to prevent UNDO on guternberg block editor
- Do I have to worry about useState causing a re-render?
- Creating a custom Gutenberg block with columns
- “import declarations may only appear at top level of a module” when importing WooCommerce API node module
- wp.template() returns tags in Ajax response
- Gutenberg: import dependency or assign from global variable?
- My WordPress plugin cannot load my JavaScript file
- add javascript files only when plugin is called?
- How can I avoid conflicts between plugin and theme?
- How to control an elements classes from multiple Gutenberg sidebar controls?
- How should I go about registering JavaScript that isn’t a file? [duplicate]
- Run JavaScript validation script on form submit in plugin
- Custom Plugin – CSS works, JS doesn’t
- Translate javascript with WordPress built-in localization API for static strings
- Need help about understand api, wp, $ syntax in WordPress plugin script
- How to add a panel/box/widget/are/screen to the right side of edit post/page confusion
- Insert Into Post Not Working For Audio File Using jQuery
- Service Worker Uncaught (in promise) DOMException
- Developing the save function in Gutenberg blocks
- How to overwrite iris color pallates from theme to plugin
- About a programming language starts with [closed]
- How to insert HTML/CSS/JS into my iframe plugin?
- Is there a WordPress plugin to design WebGL? [closed]
- Should I put my plugin javascript inline?
- How to write a shopping queue line plugin with a queue button?
- wp.media libary pdf type
- wp.media gallery collection sometimes undefined
- Query String Filtering API
- Getting incorrect filepath inside custom block front-end output using @wordpress/create-block tutorial
- Trigger function on Remove block or add new block in Gutenberg JavaScript
- Multiple TinyMCE on button click is initialized and appended but why only last one is writeable?
- Rerender core Templates with with ToggleControl but it doesnt recognize block type
- HTMLCollection not counting right in editor? / for loop not working on elements in DOM
- converting a node.js project into a wp plugin
- Is “document loaded” different on admin side than public side?
- How to use setAttributes outside of the edit function return
- why is apiFetch throwing Unhandled Promise Rejection: TypeError: Object is not a function
- jQueryUI draggable doesn’t work in WordPress plugin
- Reading plugin settings in esnext wordpress block
- Load script on frontend from widget plugin
- WordPress with React: Saving and Using Data Collected with fetch
- Append php file to footer
- Can’t get wpColorPicker to work in a widget
- XMLHttpRequest to open PHP file responds with Missing Page
- Integrating colorpicker into array field
- Using JavaScript in WordPress page to call for server data using AJAX
- Filterable posts using categories
- Add a Script button in W3 Total Cache plugin not working due to conflicting jQuery version
- Uncaught ReferenceError: kpoejy is not defined
- Remove from a div by class name from post page if post author role is not administrator
- On one of my sites a file is shown as 404 but the file IS there
- How can i add insertion point between inner blocks in my custom block like core blocks
- How react js and other Javascript Technologies works on WordPress plugin?
- Trigger a JavaScript function based on the data fetched from Woo commerce hook
- How can create a custom plugin to call my webapi after any registration or membership plugin functionality
- Trouble Importing whatsapp-web.js in a WordPress Plugin Development
- Insert meta-description into Yoast-SEO input-field via JavaScript
- Reinitiate Gutenburg’s blocks using javascript
- how to add contact form 7 shortcode in javascript variable
- Insert text programmatically in WordPress Gutenberg Editor
- Javascript function defined in view.js not reachable from save.js
- How to use useSelect to retrieve the currently default fontFamily?
- Event when Modal is opened/visible
- Is It Possible to Use the Block Editor’s Notification Feature to Send Another Notification After the Post Is Saved?