Home › Forums › Backend Issues (wp-admin) › Sorting a column for a user field › Reply To: Sorting a column for a user field
first i have to ask what version of ACF are you using. You mention that one of the db fields looks like 32 required
and the required part has be confused, that should not be there. The user field is a field in ACF and it stores user ID values. The difference between a single value 32
and something that looks like this a:1:{i:0;s:3:”281″;})
is whether or not the field allows multiple selections of only a single selection. The second value is a field that allows multiple selections and stores an array of user IDs and what you’re seeing is a serialized value. How you search posts based on the value will depend on what type whether or not your searching a field that allows multiple values or not. If you’re searching a field that uses a single value then you can search for just the value, but if it’s one that allows multiple then you need to use something like LIKE '"'.$user_ID.'"'
The shorting problem is going to be a bit more difficult, and that’s also going to depend on what type of user field you’re searching, there’s too many variables at this point to begin helping you sort that part out.
The first thing we have to do is nail down if the field you’re searching allows 1 or multiple values.
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.