Getting post user data

This topic contains 4 replies, has 2 voices, and was last updated by  Alex Howes 6 years, 6 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #2256

    Alex Howes
    Buyer
    Post count: 175

    Hello,

    Does usersWP have a function that I can use programmatically (in a snippet) to get and change fields of the user’s profile? A sort of geodir_get_post_meta but for user information rather than posts.

    Thanks 🙂
    Alex

    #2265

    Patrik
    Moderator
    Post count: 1971

    Hi Alex,

    Can you give an example so that we can have more idea about what exactly you want here?

    What I understand is you want to get user’s profile fields programmatically and modify it. If so then you can use the function `uwp_get_usermeta_row($user_id)’ which will give all the form fields based on user ID you have passed. Let me know if this is what you want or something else.

    Regards,
    Patrik

    #2267

    Alex Howes
    Buyer
    Post count: 175

    Great, thanks. Is there a way to get a specific field from the user meta? And is there a function that I can use to change the user meta?

    Thanks for your help!
    Alex

    #2270

    Patrik
    Moderator
    Post count: 1971

    Hi Alex,

    You can use following function to change the user meta using user id and meta key:

    uwp_update_usermeta( $user_id, $key, $value )

    Also, to get specific field you can use the following function:

    uwp_get_usermeta( $user_id, $key, $default )

    Let me know if this works for you or not.

    Regards,
    Patrik

    #2275

    Alex Howes
    Buyer
    Post count: 175

    Great, thanks! 🙂

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

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket