WordPress.org

Ready to get started?Download WordPress

Forums

Custom meta box for custom post type admin UI (1 post)

  1. Peter_L
    Member
    Posted 3 years ago #

    Hello,

    I made a [custom meta box] for a [custom post type].
    Inside this custom meta box I use jQuery UI datepicker on an input field.

    Everything works, but
    I was unable to make this work on WordPress' local jQuery UI, I had had to use google apis jQuery UI through register and enqueue script.

    Now, however, it loads jquery UI and my jquery script to trigger the datepicker on every page of the wordpress admin UI.
    My question: how can I make it so these scripts only load on my custom post type admin UI?
    Is there something like

    if((is_admin)&&(is_mycustomposttype)){
        load scripts;
    }

    thnx

Topic Closed

This topic has been closed to new replies.

About this Topic