Skip to content

Latest commit

 

History

History
45 lines (30 loc) · 1.18 KB

README.md

File metadata and controls

45 lines (30 loc) · 1.18 KB

WordPress User Last Modified

WordPress Versions PHP Versions

A WordPress code library for tracking the user last modified date and time.

Installation

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';

Usage

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

Notes

If used within a WordPress plugin or theme, the code will auto-initialize.