Registration date column for users
Adds a sortable “Registered” column to the users list.
<?php
add_filter(
'manage_users_columns',
static function ( $columns ) {
$columns['snipfire_registered'] = __( 'Registered' );
return $columns;
}
);
add_filter(
'manage_users_sortable_columns',
static function ( $columns ) {
$columns['snipfire_registered'] = 'registered';
return $columns;
}
);
add_filter(
'manage_users_custom_column',
static function ( $output, $column, $user_id ) {
if ( 'snipfire_registered' !== $column ) {
return $output;
}
$user = get_userdata( $user_id );
return $user ? esc_html( wp_date( get_option( 'date_format' ), strtotime( $user->user_registered . ' UTC' ) ) ) : '';
},
10,
3
);
In these packs
- Users and profiles: Registration dates, last logins, social profile fields, longer sessions and stricter passwords.