Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
get_users and meta_key
-
Hello,
Why does ACF saves user meta fields in wp_options, rather than wp_usermeta, the table designed for these values? Since ACF does not save the values there, meta_key/meta_value queries in WP Query objects do not work. An example is the get_users functions which supports meta_key/meta_value. -
Hi nielsvr,
That is a very good point.
I'll add this to the to-do and hopefully implement this soon
Cheers
Elliot -
Any timescale on when this will be added? I'm surprised ACF isn't handling the addition of custom user fields the correct way.
Are there other instances like this we should know about?
In my research I saw a premium user profile plugin author say they built their plugin because the existing solutions weren't doing things right. Now I know what they mean.
Hopefully this will be fixed in ACF soon. -
I had the same issue and ended up using the 'User Meta' plugin, it done the trick.
-
I see this is tagged as to-do in the next version, any idea when this will be released as I have a project that needs this (and integrated with Gravity Forms) - I nearly bought another plugin to do this but would much prefer if it all worked in ACF :)
-
Looks like it's out in the latest version - 3.4.1
-
Will this new change affect existing code that was done using the old method? Just want to make sure I'm not going to have a few clients calling that upgraded and their site is now broken :)
-
Im curious too, implemented the old method with selected users from the options table; will that stop working at the moment a client with an updated ACF updates a user?
-
Awesome! It is done, user data is on user_metadata!
-
Hi guys,
yes, in v3.4.1 the user custom field values have moved over to the wp_user_meta table (as they should have been all along).
If you are using the ACF functions (get_field, the_field, etc) then you will have no issues with the update. However, if you were using the wp functions such as get_option, then yes, you will have issues finding the user values.
So you can now query users via the meta data!
Cheers
Elliot -
That's strange, guys! I found this issue today, when I got the plugin on my Wordpress instalation. Currently using ACF v3.5.0 and WP v3.4.2. When I try to assign the fields to a user profile, it just shows me nothing. No errors at all.
Any hints how can I fix that?