Adding Datepicker to User Profile In admin

add_action( 'admin_enqueue_scripts', 'enqueue_date_picker' );

function enqueue_date_picker(){
		$js_url = get_bloginfo('template_url')."/js/Field_Date.js";
		   wp_enqueue_script(
			'field-date-js',
			$js_url,
			array('jquery', 'jquery-ui-core', 'jquery-ui-datepicker'),
			time(),
			true
		);	
		wp_enqueue_style( 'jquery-ui-datepicker' ,'http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.0/themes/base/jquery-ui.css');
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s