helen / wp-19867-9864

Don't master it.
4 stars 3 forks source link

Include Select2 and a basic implementation in wp_dropdown_users(). #2

Closed ericandrewlewis closed 10 years ago

ericandrewlewis commented 10 years ago

Queries users in a dumb fashion at the moment (no preference for users that write a lot), but does scale with search and basic pagination.

helen commented 10 years ago

I think it's probably better if the original function can still return a normal select element with an arg that switches to using a JS helper, with that arg set to true if you're in the admin and the count of users is over some limit. I implemented that in my experimental patches on the ticket.

I don't mind merging now, but given that we're aiming for a patch and this can be used by plugins and on the front end, I'd rather not wander too far from back compat.

helen commented 10 years ago

Also - how does i18n work with Select2? I haven't investigated, just curious.

ericandrewlewis commented 10 years ago

Helen said

probably better if the original function can still return a normal select element with an arg that switches to using a JS helper

:bulb: That makes a lot of sense - missed that first rung; that makes back-compat easy.

ericandrewlewis commented 10 years ago

how does i18n work with Select2?

Select2 has drop-ins like these which are expected to be included after Select2 core to override defaults. We can do something similar, but make : localize strings server-side and localize core manually via WP_Scripts->add_data()

ericandrewlewis commented 10 years ago

Let's hold on merging until we're happy with this. I'll add a few more commits for i18n and back-compat.

ericandrewlewis commented 10 years ago

This has been a good first run - I think we're merge ready with intent to iterate.