WordPress.org

Forums

[resolved] jquery-ui-dialog script moved out of 3.9 latest build? (11 posts)

  1. heatmap
    Member
    Posted 1 year ago #

    Hi Guys,

    I just noticed that one of my plugins was no longer popping up dialogues in the admin on latest 3.9 build because jquery-ui-dialog script doesn't appear to be enqueued by 3.9.

    Is this now removed by default or deprecated? or has it just been missed?

    Thanks.

  2. jquery.ui.dialog.min.js is still included in WP, but your plugin should be calling it as required in wp_enqueue_script to ensure it's called on the pages it's used. Which plugin is this?

  3. heatmap
    Member
    Posted 1 year ago #

    Thanks Mika,

    Its Click Missile plugin but its not in the repo.

    Its got a tinymce button which pops up a box so ad short codes can be inserted.

    Yes, I now see the script is there in 3.9 and am now enqueueing it from within the plugin rather than relying on wp to do it by default.

    It always seemed to work though in previous WP versions without having to enqueue it in the plugin so other plugins with similar functionality may break if not updated to cater for the change.

    For others reading this with similar jquery dialog issues when 3.9 drops
    the following code was required to make things work again....

    wp_enqueue_script( 'jquery-ui-dialog' );
    wp_enqueue_style( 'wp-jquery-ui-dialog' );
  4. Sergey Biryukov
    WordPress Dev
    Posted 1 year ago #

    Looks like jquery-ui-dialog is no longer automatically enqueued since [27494].

  5. It would be better to put jquery-ui-dialog as a requirement:

    wp_enqueue_script(
    		'myscript',
    		plugins_url( '/myscript.js' , __FILE__ ),
    		array( 'jquery-ui-dialog' )
    	);

    So you have one enqueue script :) But that's semantics.

  6. heatmap
    Member
    Posted 1 year ago #

    nice one! ;)

  7. heatmap
    Member
    Posted 1 year ago #

    ...hears sound of a thousand plugin owners dashing to awesome page above to fix their jquery dialogs...

    ...closely followed by wailing and gnashing of teeth after release of 3.9 from users of plugins that don't get updated :)

  8. heatmap
    Member
    Posted 1 year ago #

    Just as a further update for others who come across this thread...

    When jquery-ui-dialog is used in a theme or plugin but the function is not found in 3.9 it can create a javascript error which can then potentially block other dynamic parts of the page from working (at least it did for my plugin until I fixed it for 3.9).

    So for instance if the plugin adds a popup dialog with a tinymce button in the post page, if the jquery dialog function is not enqueued then side effects I noticed were as follows:

    - items in the 'Published' metabox did not slide open as they should
    - this includes the 'status' and 'visibility' fields

    So if you suddenly notice that items in the publish metabox do not work, then have look to see if its because jquery dialog has not been enqueued in 3.9

  9. FWIW, I brought this up with the core team as a potential arrrg moment.

    It's one of those things where developers should have been enquing it begin with, but since it was on the only page they'd use it on (for the most part) they didn't notice.

    wpdialogs is what was removed, and is what called jquery-ui-dialog from what I can see.

  10. heatmap
    Member
    Posted 1 year ago #

    Thanks for that Mika.
    If anything happens with that let us know if you can. Ta :)
    Much appreciated.

Topic Closed

This topic has been closed to new replies.

About this Topic