A WordPress code library for tracking the user last modified date and time.
Install Composer.
In your WordPress plugin or theme directory, run:
composer require wp-forge/user-last-modified
Make sure you have this line of code in your project:
<?php
require __DIR__ . '/vendor/autoload.php';
How to fetch the user last modified date/time:
<?php
use WP_Forge\UserLastModified;
$user_id = 1; // The id of the user
$date_format = 'c'; // Any format that DateTime accepts (e.g. U for unix timestamps, c for ISO8601, etc.)
UserLastModified::get( $user_id, $date_format );
If used within a WordPress plugin or theme, the code will auto-initialize.