amy-d
9/15/2013 - 3:33 PM

Adding Date Picker to Admin Custom Post Type This goes in function.php From http://wordpress.stackexchange.com/questions/15656/add-a-jquery

Adding Date Picker to Admin Custom Post Type

This goes in function.php From http://wordpress.stackexchange.com/questions/15656/add-a-jquery-datepicker-to-custom-field-in-post-edit

// Register datepicker ui for properties
function admin_homes_for_sale_javascript(){
    global $post;
    if($post->post_type == 'homes-for-sale' && is_admin()) {
        wp_enqueue_script('jquery-ui-datepicker', WP_CONTENT_URL . '/themes/philosophy/js/jquery-ui-datepicker.min.js');  
    }
}
add_action('admin_print_scripts', 'admin_homes_for_sale_javascript');

// Register ui styles for properties
function admin_homes_for_sale_styles(){
    global $post;
    if($post->post_type == 'homes-for-sale' && is_admin()) {
        wp_enqueue_style('jquery-ui', WP_CONTENT_URL . '/themes/philosophy/css/jquery-ui-1.8.11.custom.css');  
    }
}
add_action('admin_print_styles', 'admin_homes_for_sale_styles');