Why is wp_enqueue_script not loading included jquery ui scripts?

I guess you have to really read the Codex about wp_enqueue_script() again and then dig into jQuery a little bit more. jQuery UI is a dependency of jQuery (which means it depends on having jQuery loaded). So you need to load jQuery first, before loading jQuery UI (or jQuery UI Mobile).

Edit as per @ChipBennet and @MannyFleurmond comments below:

  1. There’s no need to add array( 'jquery' ) as $dependency argument for jquery-ui-core, as Chip shows us in this core reference
  2. As Manny stated, you need to add every effect/plugin by itself, like for e.g. 'jquery-effects-fold', 'jquery-ui-resizable' or 'jquery-effects-explode'.
  3. The example is right, but missing the (possibly) needed plugins

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

Leave a Comment