Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
plugins-topic
wp_enqueue_script and jquery & plugins...
Avatar
Lee H
Coastal New England (USA)
Member
Free Members
Offline
Oct 2, 2011 - 8:14 pm

My little plugin has a js file I made and I use wp_enqueue_script to load it, and I've chosen jquery ui dialog as it's dep. Following SP's lead, I had the dep as jquery.ui.dialog (note the dots). Now with the recent js related commits, SP has dropped the dots for hypens like this: jquery-ui-dialog. And broke my plugin.

Is this the way it will be for now on? Is it dependent on WP version, or will it be this way a crossed the board for jquery related js?

Just asking 🙂

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
Offline
Oct 2, 2011 - 10:55 pm

well, there you go...  one of those not the best things we did with loading js...  there is no need for us to do it the old way... we used to have the hard coded path to the wp js file...  so when wp changed the location, we had to change our code... we really should have just been enqueueing the already registered wp script...

that is what we do now...  so you too should make your plugin dependent on the wp jquery ui dialog, not ours...

and yes, jquery-ui-dialog is the name wp assigned when they registered the script...  so you can do dependancy or just force its loading with

wp_enqueue_script('jquery-ui-dialog');

Avatar
Lee H
Coastal New England (USA)
Member
Free Members
Offline
Oct 2, 2011 - 11:08 pm

Hah, hah!! Don't get me wrong Steve, I wasn't trying to throw you guys under the bus! Now I feel bad. Just trying to see where this was headed so I can keep playing with the code smile

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
Offline
Oct 2, 2011 - 11:10 pm

oh, didnt take it that way...  no need to feeel bad! laugh

was a bit surprised we were doing it the hard way when I went through it this weekend...  much better, I think, now...

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 620
Members: 17365
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10128
Posts: 79626