MediaWiki  master
MediaWiki\Hook\GetHumanTimestampHook Interface Reference

This is a hook handler interface, see docs/Hooks.md. More...

Inheritance diagram for MediaWiki\Hook\GetHumanTimestampHook:

Public Member Functions

 onGetHumanTimestamp (&$output, $timestamp, $relativeTo, $user, $lang)
 Use this hook to preemptively override the human-readable timestamp generated by MWTimestamp::getHumanTimestamp(). More...
 

Detailed Description

This is a hook handler interface, see docs/Hooks.md.

Use the hook name "GetHumanTimestamp" to register handlers implementing this interface.

Stable to implement

Definition at line 16 of file GetHumanTimestampHook.php.

Member Function Documentation

◆ onGetHumanTimestamp()

MediaWiki\Hook\GetHumanTimestampHook::onGetHumanTimestamp ( $output,
  $timestamp,
  $relativeTo,
  $user,
  $lang 
)

Use this hook to preemptively override the human-readable timestamp generated by MWTimestamp::getHumanTimestamp().

Since
1.35
Parameters
string&$outputOutput timestamp
MWTimestamp$timestampCurrent (user-adjusted) timestamp
MWTimestamp$relativeToRelative (user-adjusted) timestamp
User$userUser whose preferences are being used to make timestamp
Language$langLanguage that will be used to render the timestamp
Returns
bool|void True or no return value to continue, or false to use the custom output

Implemented in MediaWiki\HookContainer\HookRunner.


The documentation for this interface was generated from the following file: