0

I am developing a plugins to WordPress and I need to add on an admin page some components of http://jqueryui.com/ I need to add, modal window, accordion, progress bar and a slider.

I want to know the following why I'm new to developing plugins in WordPress:

  1. WordPress has integrated jQuery UI?
  2. In the official page of https://codex.wordpress.org do I have an option similar to https://jqueryui.com/ that has add-ons to copy and paste?
  3. I can add libraries like jQuery UI to my plugins without causing any problems in WordPress

Thanks for your help

1

WordPress has integrated jQuery UI?

The official docs lists that a large amount of jQuery UI is present in core already, and needs only to be enqueued:

https://developer.wordpress.org/reference/functions/wp_enqueue_script/

In the official page of https://codex.wordpress.org do I have an option similar to https://jqueryui.com/ that has add-ons to copy and paste?

No it doesn't, but that's because it isn't necessary. jQuery UI works the same way in WP Admin as it does anywhere else, the javascript works identically. Simply enqueue the script, then use it in your own JS files once the document is loaded as you would anywhere else.

If you require copy pasta, you can get it from jqueryui.com and all the usual places.

I can add libraries like jQuery UI to my plugins without causing any problems in WordPress

As long as you use the library bundled with WordPress core you should be fine. If you try to bundle jQuery UI inside your plugin however, then there can be conflicts, as different versions are loaded at the same time.

The same is true of any code that bundles jQuery, e.g. when developers over-optimise and try to use the CDN jQuery, loading it a second time, which can cause issues when other plugins expect the version core has but get your plugins version instead ( or when every plugin tries to register its own version )

|improve this answer|||||
  • How can I add CSS styles from JqueryUI? This page appearshttps://developer.wordpress.org/reference/functions/wp_enqueue_script/ only link to the JS files, and loads the functions but not the styles when adding them – Learning and sharing Sep 21 '17 at 19:01
  • refer to the wp_enqueue_styles page for the styles – Tom J Nowell Sep 21 '17 at 23:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.