Membership Plugin

WordPress Membership Plugin

  • Home
  • Documentation
  • Addons
  • Support
    • Quick Setup
    • Documentation
    • Premium Addon Support
    • Paid Support
    • Support Forum
    • Support Forum Search
    • Forum Login
    • Forum Registration
  • Contact

[Resolved] Display logged-in user's name

Simple Membership Plugin › Forums › Simple Membership Plugin › Display logged-in user's name

  • This topic has 2 replies, 2 voices, and was last updated 8 years, 2 months ago by Dayo.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • March 30, 2018 at 3:33 pm #13892
    Dayo
    Participant

    I want to display the logged-in user’s name and info on the front-end and I dont know how to make this work.

    I already have the code below in my functions.php but I dont know how to display it on the front-end OR which hook to use:

    // Get user name
    function user_details() {
      $user_id = SwpmMemberUtils::get_logged_in_members_id();
      $fname = SwpmMemberUtils::get_member_field_by_id($user_id, 'first_name');
      $lname = SwpmMemberUtils::get_member_field_by_id($user_id, 'last_name');
      $user_name = $fname . ' ' . $lname;
      return $user_name;
    }

    thanks

    March 30, 2018 at 8:24 pm #13898
    The Assurer
    Moderator

    I want to display the logged-in user’s name and info on the front-end and I dont know how to make this work.

    Can you do this using shortcodes instead?
    https://simple-membership-plugin.com/simple-membership-addon-show-member-info/

    March 30, 2018 at 10:25 pm #13908
    Dayo
    Participant

    I have marked this thread as “Resolved”. I HAVE BEEN ABLE TO MAKE IT WORK.

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Log In

Please read this message before using our plugin.

Search

Featured Addons and Extensions

  • Membership Form Builder Addon
  • Member Directory Listing Addon
  • WooCommerce Payment Integration
  • Member Data Exporter Addon

Documentation

  • Documentation Index Page

Copyright © 2026 | Simple Membership Plugin | Privacy Policy