Registration Date Column in the Users List
Adds a sortable "Registered" column to the Users screen showing when each account was created.
Opens WPIDE on
Code
add_filter( 'manage_users_columns', function ( $columns ) {
$columns['wpide_registered'] = 'Registered';
return $columns;
} );
add_filter( 'manage_users_custom_column', function ( $output, $column, $user_id ) {
if ( 'wpide_registered' !== $column ) {
return $output;
}
$user = get_userdata( $user_id );
return $user ? esc_html( get_date_from_gmt( $user->user_registered, get_option( 'date_format' ) ) ) : $output;
}, 10, 3 );
add_filter( 'manage_users_sortable_columns', function ( $columns ) {
$columns['wpide_registered'] = 'registered';
return $columns;
} );
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.