Home › Forums › Front-end Issues › User field – Select2 doesn't search for names › Reply To: User field – Select2 doesn't search for names
Select2 is just a JavaScript api that fills the fields and allows dong so using AJAX, it does not connect directly to the DB to get information or alter the way WP works. The underlying function that gets those values for display is still part of WP.
As you can see by looking at the php file for the users field (/fields/user.php) on lines 129 to 135.
// filters
$args = apply_filters("acf/fields/user/query", $args, $field, $options['post_id']);
$args = apply_filters("acf/fields/user/query/name={$field['_name']}", $args, $field, $options['post_id']);
$args = apply_filters("acf/fields/user/query/key={$field['key']}", $args, $field, $options['post_id']);
// get users
$users = get_users( $args );
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.