Home Forums Plugin Support WP User Frontend Pro Getting $userdata

This topic is: resolved

This topic contains 9 replies, has 2 voices, and was last updated by  towhid 3 years, 10 months ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #65199

    MareVisie
    Member
    Post count: 83

    Hi,

    How do I get the user data I stored using a registration form for a specific user?

    #65439

    towhid
    Participant
    Post count: 4505

    Hello MareVisie,

    Use this function for retrive user date get_userdata( $userid );

    Also, please check this link:

    https://codex.wordpress.org/Function_Reference/get_userdata

    Thanks

    #65442

    MareVisie
    Member
    Post count: 83

    Hi Towhid,

    Thank you for your reply.

    Does WPUF store new meta keys made by Registration Forms in an existing WordPress database table? Or does it have its own dedicated table?

    #65448

    towhid
    Participant
    Post count: 4505

    Helloo MareVisie,

    User data goes to wp_users table in the WordPress database.

    Thanks

    #67021

    MareVisie
    Member
    Post count: 83

    Hi Towhid,

    Due to other matters that deserved my attention I haven't gotten to this untill now. I have tried using your method, however I can't seem to get the custom field data I want using get_userdata($userid). Here's the output I get when using $userid = 1:

    
    object(WP_User)[1993]
      public 'data' => 
        object(stdClass)[1992]
          public 'ID' => string '1' (length=1)
          public 'user_login' => string 'Sjors' (length=5)
          public 'user_pass' => string '*LEFT OUT FOR PRIVACY*' (length=34)
          public 'user_nicename' => string 'sjors' (length=5)
          public 'user_email' => string '*LEFT OUT FOR PRIVACY*' (length=30)
          public 'user_url' => string 'http://www.srcthor.nl' (length=21)
          public 'user_registered' => string '2015-08-03 07:16:22' (length=19)
          public 'user_activation_key' => string '' (length=0)
          public 'user_status' => string '0' (length=1)
          public 'display_name' => string 'Sjors' (length=5)
      public 'ID' => int 1
      public 'caps' => 
        array (size=1)
          'administrator' => boolean true
      public 'cap_key' => string 'wp_capabilities' (length=15)
      public 'roles' => 
        array (size=1)
          0 => string 'administrator' (length=13)
      public 'allcaps' => 
        array (size=84)
          'switch_themes' => boolean true
          'edit_themes' => boolean true
          'activate_plugins' => boolean true
          'edit_plugins' => boolean true
          'edit_users' => boolean true
          'edit_files' => boolean true
          'manage_options' => boolean true
          'moderate_comments' => boolean true
          'manage_categories' => boolean true
          'manage_links' => boolean true
          'upload_files' => boolean true
          'import' => boolean true
          'unfiltered_html' => boolean true
          'edit_posts' => boolean true
          'edit_others_posts' => boolean true
          'edit_published_posts' => boolean true
          'publish_posts' => boolean true
          'edit_pages' => boolean true
          'read' => boolean true
          'level_10' => boolean true
          'level_9' => boolean true
          'level_8' => boolean true
          'level_7' => boolean true
          'level_6' => boolean true
          'level_5' => boolean true
          'level_4' => boolean true
          'level_3' => boolean true
          'level_2' => boolean true
          'level_1' => boolean true
          'level_0' => boolean true
          'edit_others_pages' => boolean true
          'edit_published_pages' => boolean true
          'publish_pages' => boolean true
          'delete_pages' => boolean true
          'delete_others_pages' => boolean true
          'delete_published_pages' => boolean true
          'delete_posts' => boolean true
          'delete_others_posts' => boolean true
          'delete_published_posts' => boolean true
          'delete_private_posts' => boolean true
          'edit_private_posts' => boolean true
          'read_private_posts' => boolean true
          'delete_private_pages' => boolean true
          'edit_private_pages' => boolean true
          'read_private_pages' => boolean true
          'delete_users' => boolean true
          'create_users' => boolean true
          'unfiltered_upload' => boolean true
          'edit_dashboard' => boolean true
          'update_plugins' => boolean true
          'delete_plugins' => boolean true
          'install_plugins' => boolean true
          'update_themes' => boolean true
          'install_themes' => boolean true
          'update_core' => boolean true
          'list_users' => boolean true
          'remove_users' => boolean true
          'add_users' => boolean true
          'promote_users' => boolean true
          'edit_theme_options' => boolean true
          'delete_themes' => boolean true
          'export' => boolean true
          'list_roles' => boolean true
          'create_roles' => boolean true
          'edit_roles' => boolean true
          'delete_roles' => boolean true
          'edit_role_menus' => boolean true
          'edit_posts_role_permissions' => boolean true
          'edit_pages_role_permissions' => boolean true
          'edit_nav_menu_permissions' => boolean true
          'edit_content_shortcodes' => boolean true
          'delete_content_shortcodes' => boolean true
          'edit_login_redirects' => boolean true
          'delete_login_redirects' => boolean true
          'edit_attachments' => boolean true
          'delete_attachments' => boolean true
          'read_others_attachments' => boolean true
          'edit_others_attachments' => boolean true
          'delete_others_attachments' => boolean true
          'edit_users_higher_level' => boolean true
          'delete_users_higher_level' => boolean true
          'promote_users_higher_level' => boolean true
          'promote_users_to_higher_level' => boolean true
          'administrator' => boolean true
      public 'filter' => null
    

    Settings used in the REGISTRATION form creator (admin panel)

    Profile page as it appears in the frontend

    #67023

    MareVisie
    Member
    Post count: 83

    The following SQL query also returns empty:

    SELECT COLUMN_NAME, TABLE_NAME 
    FROM INFORMATION_SCHEMA.COLUMNS 
    WHERE COLUMN_NAME 
    LIKE '%wpuf%'
    
    #67030

    MareVisie
    Member
    Post count: 83

    I can get the form fields using wpuf_get_form_fields( $id ) however, I can't find how to get the corresponding values stored in the database

    #67483

    towhid
    Participant
    Post count: 4505

    Hello MareVisie,

    In the “usermeta” table, user's values are stored (along with any custom fields that are added).

    To get the user meta value please use this method get_user_meta().

    Please check this link – https://codex.wordpress.org/Function_Reference/get_user_meta

    Thanks

    #67567

    MareVisie
    Member
    Post count: 83

    Hi towhid,

    Perfect, that's what I was looking for! Thank you.

    #67645

    towhid
    Participant
    Post count: 4505
    This reply has been marked as private.
Viewing 10 posts - 1 through 10 (of 10 total)

The topic ‘Getting $userdata’ is closed to new replies.