Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wordpress implementation gives error .button is not a function #110

Open
steeevio opened this issue Apr 29, 2018 · 1 comment
Open

Wordpress implementation gives error .button is not a function #110

steeevio opened this issue Apr 29, 2018 · 1 comment

Comments

@steeevio
Copy link

I've been trying to switch to this from version 1 which has been working great for me, but on upgrading to this version I get an error "Uncaught TypeError: $(...).addClass(...).attr(...).attr(...).button is not a function" That suggests to me it's a jquery ui issue but as far as I can tell jquery and jquery ui are both loading correctly

@zodit
Copy link

zodit commented May 8, 2022

This happens because WordPress is loading Jquery-ui partially.

If you are in the backend you should have already the core library, but if you are in frontend you should load this:

wp_enqueue_script('jquery-ui-core');

But this is not enough, in this case mutliselect wants also "button", then you add this:

wp_enqueue_script('jquery-ui-button');

Now multiselect should work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants