Last active
December 13, 2015 21:58
-
-
Save cdcarson/4981186 to your computer and use it in GitHub Desktop.
Adding the WordPress jQuery Color Picker
This file contains 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
jQuery(document).ready(function($){ | |
$('input.color').wpColorPicker(); | |
}); |
This file contains 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
<?php | |
class MyPlugin{ | |
public function _action_admin_enqueue_scripts(){ | |
global $pagenow; | |
if ('themes.php' != $pagenow) return; | |
if (self::SLUG != $_GET['page']) return; | |
wp_enqueue_script('wp-color-picker'); | |
wp_enqueue_style('wp-color-picker'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment