wc_update_user_last_active()WC 3.4.0

Set the user last active timestamp to now.

No Hooks.

Return

null. Nothing (null).

Usage

wc_update_user_last_active( $user_id );
$user_id(int) (required)
User ID to mark active.

Changelog

Since 3.4.0 Introduced.

wc_update_user_last_active() code WC 9.4.2

function wc_update_user_last_active( $user_id ) {
	if ( ! $user_id ) {
		return;
	}
	update_user_meta( $user_id, 'wc_last_active', (string) strtotime( gmdate( 'Y-m-d', time() ) ) );
}