Monday, August 13, 2012

Using jQuery UI datepicker with WordPress custom post meta

if(is_admin()) {
wp_enqueue_script('jquery-ui-datepicker');
wp_enqueue_script('custom-js', get_template_directory_uri().'/js/custom-js.js');
wp_enqueue_style('jquery-ui-custom', get_template_directory_uri().'/css/jquery-ui-custom.css');
}
function my_admin_footer() {
?>
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery('#registration_lastdate').datepicker({
dateFormat : 'd M yy'
});

jQuery('#training_date').datepicker({
dateFormat : 'd M yy'
});
});
</script>
<?php
}
add_action('admin_footer', 'my_admin_footer');

No comments:

Post a Comment