View - Can I pull User info

Support MB Views View - Can I pull User info

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #45488
    Mark DowdMark Dowd
    Participant

    If I have UserId can I use a MB VIEW to pull First Name, Last Name, custom fields...etc

    I cannot locate any code examples.

    Thanks in advance.

    #45495
    PeterPeter
    Moderator

    Hello,

    In the view editor, you can use the proxy mb. and WordPress functions (or any PHP functions) to get the user data from the user ID. For example: WP function get_userdata()

    {% set user_data = mb.get_userdata( 3 ) %}
    {{ user_data.first_name }}

    Following the documentation https://docs.metabox.io/extensions/mb-views/#running-php-functions

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.