WordPress wp_get_current_user() Getting the current user


Example

Getting all the information of current user in wordpress using the predefined function wp_get_current_user();

<?php
    
        $current_user = wp_get_current_user();
    
        echo "Username :".$current_user->user_login;
        echo "Username :".$current_user->ID;
        echo "Username :".$current_user->user_pass;
        echo "Username :".$current_user->user_nicename;
        echo "Username :".$current_user->user_email;
        echo "Username :".$current_user->user_url;
        echo "Username :".$current_user->user_registered;
        echo "Username :".$current_user->user_activation_key;
        echo "Username :".$current_user->user_status;
        echo "Username :".$current_user->display_name;
        
    ?>