Last active
June 26, 2021 23:44
-
-
Save cagriuckan/a3c955cf582836533e4a2115fafaf321 to your computer and use it in GitHub Desktop.
Show user date of registration in user profile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function show_user_date_of_registration( $user ) | |
{ | |
$udata = get_userdata( $user->ID ); // user data | |
$registered = $udata->user_registered; // user register date | |
return date_i18n( "j M Y", strtotime( $registered )); // out | |
} | |
// Usage in author.php | |
$user = (isset($_GET['author_name'])) ? get_user_by('slug', $author_name) : get_userdata(intval($author)); | |
echo show_user_date_of_registration($user); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment