Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
<?php
add_action( 'admin_head-edit-tags.php', 'baw_admin_enqueue_scripts' );
function baw_admin_enqueue_scripts() {
global $taxnow;
if ( 'category' != $taxnow ) {
return;
}
wp_enqueue_style( 'wp-color-picker' );
wp_enqueue_script( 'wp-color-picker' );
add_action( 'admin_footer', 'baw_term_colors_print_scripts' );
}
function baw_term_colors_print_scripts() {
?>
<script type="text/javascript">
jQuery( document ).ready( function( $ ) {
$( '#baw_term_color' ).wpColorPicker();
} );
</script>
<?php
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment