Coder Social home page Coder Social logo

Comments (5)

elliotcondon avatar elliotcondon commented on June 10, 2024

Hi @hbi99

Thanks for the question, but I don't understand.

Please review the Select2 examples here:
http://ivaynberg.github.io/select2/

from acf-field-type-template.

hbi99 avatar hbi99 commented on June 10, 2024

Yeah...but it seems that you are using an old version in ACF and it can be updated without breaking ACF. Ah well...I'll solve it anyway

from acf-field-type-template.

elliotcondon avatar elliotcondon commented on June 10, 2024

Hi @hbi99

You can register your own select2 library if you wish.
ACF will use any library that is registered before the enqueue_scripts action

from acf-field-type-template.

hbi99 avatar hbi99 commented on June 10, 2024

@elliotcondon,
Are we talking about the same thing? When javascript is getting evaluated, your old-version registers itself as plugin to jQuery. When my new version is loaded, it is not registered or extends the old version.

Please do not guess or suggest if you are not sure that your suggestion actually works.
Why don't you update this repo with the new version of Select2 instead?

from acf-field-type-template.

elliotcondon avatar elliotcondon commented on June 10, 2024

Hi @hbi99

ACF PRO will register the select2 library during an action called ''acf/input/admin_enqueue_scripts". This is a custom action that is run during the WP action "admin_enqueue_scripts" with a priority of 20.

If you hook into the "init" or "admin_enqueue_scripts" actions with a priority less than 20 (10 would be safe), you can use the wp_register_script() and wp_enqueue_script() functions.

You can see how ACF PRO registers the select2 library in the acf/fields/select.php file.

ACF uses select2 v3 due to limitations in select2 v4.
I have added compatibility with v4, but I am not adding it to my plugin until Select2 address the issues with sort-ability.

Please do not insinuate that I am 'guessing' or not attempting to help.
I am helping you for free and would appreciate your co-operation in solving your issue, not complaining.

from acf-field-type-template.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.