Skip to content

Instantly share code, notes, and snippets.

@cagriuckan
Last active June 26, 2021 23:44
Show Gist options
  • Save cagriuckan/a3c955cf582836533e4a2115fafaf321 to your computer and use it in GitHub Desktop.
Save cagriuckan/a3c955cf582836533e4a2115fafaf321 to your computer and use it in GitHub Desktop.
Show user date of registration in user profile
<?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