Display current user info in a table.
-
Hi everyone,
For the last few hours, i’ve been searching on how to display the current user info in a table, but without success. I know it’s not hard probably to do it, but i’m pretty new to coding and honestly, i’m stuck.
Would really appreciate if you guys can help me figure it out.So far, i can pull some info from the database and display it using:
<?php $current_user = wp_get_current_user(); /** * @example Safe usage: $current_user = wp_get_current_user(); * if ( !($current_user instanceof WP_User) ) * return; */ echo 'Username: ' . $current_user->user_login . '<br />'; echo 'User email: ' . $current_user->user_email . '<br />'; echo 'User first name: ' . $current_user->user_firstname . '<br />'; echo 'User last name: ' . $current_user->user_lastname . '<br />'; echo 'User display name: ' . $current_user->display_name . '<br />'; echo 'User ID: ' . $current_user->ID . '<br />'; ?>
I would like to be able to show this into a table like:
Username Email First name Last name
User01 [email protected] John DoeThanks again for your help!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Display current user info in a table.’ is closed to new replies.