Skip to content

Early-bird lifetime licence: $199 once, for the first 200 buyers only. See the offer

Registration date column for users

Adds a sortable “Registered” column to the users list.

  • Type PHP
  • Runs Everywhere (runs as WordPress loads)
  • Category Users
  • Tested with WordPress 7.1
PHP
<?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.

Move your snippets over this afternoon.

Importing changes nothing until you switch over, and your old shortcodes keep working.