Skip to content

Instantly share code, notes, and snippets.

@JulioPotier
Created November 13, 2015 01:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JulioPotier/c125e569da04ff307cb5 to your computer and use it in GitHub Desktop.
Save JulioPotier/c125e569da04ff307cb5 to your computer and use it in GitHub Desktop.
<?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