• Howdy all..

    I am writing a plugin and I have the settings area defined and working fairly nicely.. but I wanted to add some spiffy jQuery stuff using the jquery.ui and jquery.dialog functionality..

    But I can’t seem to get jquery.dialog to load..

    At the bottom of my widget definition (which is a class) I have:

    add_action("init", array('myWidget','init'),1000,0);

    This calls myWidget::init() which in turn looks like this;

    function init() {
        wp_enqueue_script('jquery-dialog');
        add_action('admin_menu', array('myWidget', 'registerAdminPage'));
    // More stuff..
    }

    The very first thing I’m doing is trying to enqueue jquery-dialog to be loaded..

    I have tried putting that call in different places and it never seems to work.

    jQuery.dialog is simply not defined..

    How do I go about loading jquery-dialog?

Viewing 1 replies (of 1 total)
  • Looking at the codex page for wp_enqueue_script shows that it’s called ‘jquery-ui-dialog’. The dialog also depends on the ui core, so you’ll need to include that too.

    wp_enqueue_script('jquery');
    wp_enqueue_script('jquery-ui-core');
    wp_enqueue_script('jquery-ui-dialog');

    I think there may actually be more to it… there’s probably some default styles to load with wp_enqueue_style.

Viewing 1 replies (of 1 total)
  • The topic ‘Loading jQuery.Dialog via enqueue_script in plugin admin area’ is closed to new replies.