Skip to content

Instantly share code, notes, and snippets.

@jg314
jg314 / gist:4489182
Last active December 10, 2015 20:38
<?php
function add_styles_scripts(){
//Access the global $wp_version variable to see which version of WordPress is installed.
global $wp_version;
//If the WordPress version is greater than or equal to 3.5, then load the new WordPress color picker.
if ( 3.5 <= $wp_version ){
//Both the necessary css and javascript have been registered already by WordPress, so all we have to do is load them with their handle.
wp_enqueue_style( 'wp-color-picker' );
wp_enqueue_script( 'wp-color-picker' );