wc_update_user_last_active()WC 3.4.0

Set the user last active timestamp to now.

Хуков нет.

Возвращает

null. Ничего (null).

Использование

wc_update_user_last_active( $user_id );
$user_id(int) (обязательный)
User ID to mark active.

Список изменений

С версии 3.4.0 Введена.

Код wc_update_user_last_active() WC 8.7.0

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() ) ) );
}