Home / user / Get user info
  • How to Get user info

    no thumbnail sorry: Get user info

    Adding this PHP code to your wordpress theme will display the current users information.

    ( click code to copy )

    wordpress snippet : PHP

    <>
    <?php global $current_user;
          get_currentuserinfo();
          echo 'Username: ' . $current_user->user_login . "\n";
          echo 'User email: ' . $current_user->user_email . "\n";
          echo 'User first name: ' . $current_user->user_firstname . "\n";
          echo 'User last name: ' . $current_user->user_lastname . "\n";
          echo 'User display name: ' . $current_user->display_name . "\n";
          echo 'User ID: ' . $current_user->ID . "\n";
    ?>
    

    ( WordPress codex functions, hooks, in this snippet. )

    get_currentuserinfo, _n, _e,
  • Cahe

    A moderator, ask personaly for PHP file couse Discuss wont let me put code in here. Previous example misses the first 3 lines of this snipped