Support

Account

Home Forums General Issues Check if custom user meta field already exists

Solving

Check if custom user meta field already exists

  • Hey! So I am creating a website where you need a token (license key) to participate in a course. I created a custom field with a numeric max character text area, and the location is role = all, so it does everything nice locates also in the user profile, and we can add a key and see it back in the user profile. Only thing I want though is when I enter a key that has already been entered by a different user ACF checks if that value is already entered, if that’s the case then maybe a message saying it has already been used or something. I tried some functions but I can’t get it to work. Any ideas? Any help is greatly appreciated!

  • I don’t have code related to your specific needs, but there is an example of accepting unique values for posts in my comment here https://support.advancedcustomfields.com/forums/topic/accept-only-unique-values/#post-45359

    The only difference is that you’d use a user query instead of a post query.

  • What would I need to change in the code so it works in the user interface of WordPress?

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.