Results 1 to 5 of 5

Thread: Determine which jQuery UI scripts are added to each admin page

  1. #1
    dgwyer's Avatar
    dgwyer is offline Tavern Regular
    Join Date
    Jun 2010
    Location
    London, UK
    Posts
    230

    Default Determine which jQuery UI scripts are added to each admin page

    Whilst jQuery is available on all admin pages, only selected jQuery UI libraries are added for certain pages. (i.e. the widgets, and nav menu admin pages).I am trying to find out where in the core the jQuery UI libraries are actually registered for EACH admin page. Where is it decided what jQuery UI libraries to load (or not).

    I have looked over quite a few core files but can't seem to track it down. Anyone have a clue where it might be?

  2. #2
    Utkarsh is offline Hello World
    Join Date
    Nov 2009
    Posts
    73

    Default

    Not sure where you looked, or if I'm correct, but here's what I found - https://github.com/markjaquith/WordP...nus.php#L26-28

  3. #3
    dgwyer's Avatar
    dgwyer is offline Tavern Regular
    Join Date
    Jun 2010
    Location
    London, UK
    Posts
    230

    Default

    It's a bit weird that the jQuery libraries are quite obviously enqueued for the nav menus page but not for others. For example, what about the post editor, or widgets page? I can't seem to find a reference to where jQuery libraries are added for those particular admin pages.

  4. #4
    Utkarsh is offline Hello World
    Join Date
    Nov 2009
    Posts
    73

    Default

    PHP Code:
    wp-admin/widgets.php
    31
    :    wp_enqueue_script('admin-widgets');

    wp-includes/script-loader.php
    346
    :        $scripts->add'admin-widgets'"/wp-admin/js/widgets$suffix.js", array( 'jquery-ui-sortable''jquery-ui-draggable''jquery-ui-droppable' ), false); 
    widgets.php enqueues 'admin-widgets', which depends on 'jquery-ui-sortable', 'jquery-ui-draggable' and 'jquery-ui-droppable'.

  5. #5
    dgwyer's Avatar
    dgwyer is offline Tavern Regular
    Join Date
    Jun 2010
    Location
    London, UK
    Posts
    230

    Default

    Ah, missed that dependency loading. Thanks for the heads-up.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •