This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Custom User Meta do not show up

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Custom User Meta do not show up

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #25874
    maurodalu54maurodalu54
    Participant

    Hello,
    Awesome plug-in. I have a problem with my custom User Meta.

    In “General Options > User Search > Search in following user meta fields” I cannot locate my own custom user meta searching by key.
    I do see user meta added by other plug-ins, i.e. MemberPress, BadgeOS.

    How do I need to register my user meta in order for Ajax Search Pro to pick them up?

    Thanks!
    Mauro.

    #25875
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi Mauro,

    The meta only shows up once there is an actual value associated with it, as the plugin looks in the user meta table.
    If you update a user profile with the new meta fields (and add values to them), they will show up.

    #25876
    maurodalu54maurodalu54
    Participant

    Hi Ernest,
    Thanks, not sure if this is a known issue, but the fields only showed up after I connected them with the user profile.
    Also, I have one field that has multiple values for the same key. That does not show up.

    I add values to the field in my code like this:
    add_user_meta($user_id, ‘my-key’, false);

    Any clue why it would not show up?

    Thanks,
    Mauro.

    #25877
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi,

    It is not really an issue, as if the field does not exist in the usermeta table, it actually does not exist until then (in the database), so it cannot be listed.
    The uniqueness does not matter, if there is at least one meta value with the field name in the usermeta table, it should show up.

    Make sure to add at least one value with that field, and it should be there.

    #25878
    maurodalu54maurodalu54
    Participant

    Ernest, thank you very much for your quick replies! Really appreciate that.
    Guess what, you’re right. My logic for conditionally adding the field was reversed!
    Now that the field is populating and connected to the user profile it is showing up.

    Thank you, you can mark this as solved 🙂

    #25880
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Custom User Meta do not show up’ is closed to new replies.