Manual:Hooks/BeforeResetNotificationTimestamp

From Linux Web Expert

BeforeResetNotificationTimestamp
<translate> Available from <tvar name=1><translate> version <tvar (Gerrit change 473958)</tvar></translate>
<translate> Removed in <tvar name=1><translate> version <tvar (Gerrit change 722707)</tvar></translate>
Allows prevention of clearing of notification timestamp when a user views a page in their watchlist.
<translate> Define function:</translate>
public static function onBeforeResetNotificationTimestamp( User $user, title $title, string $force, int $oldId ) { ... }
<translate> Attach hook:</translate> <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
	"Hooks": {
		"BeforeResetNotificationTimestamp": "MediaWiki\\Extension\\MyExtension\\Hooks::onBeforeResetNotificationTimestamp"
	}
}
<translate> Called from:</translate> <translate> File(s):</translate> watcheditem/WatchedItemStore.php
<translate> Function(s):</translate> resetNotificationTimestamp
<translate> Interface:</translate> BeforeResetNotificationTimestampHook.php

<translate> For more information about attaching hooks, see <tvar name=1>Manual:Hooks </tvar>.</translate>
<translate> For examples of extensions using this hook, see <tvar name=cat>Category:BeforeResetNotificationTimestamp extensions</tvar>.</translate>


Details

  • &$user: User object
  • &$title: Title object
  • &$force: Whether or not the write query is forced to be executed even if the page is not watched or the notification timestamp is already NULL.
  • $oldId: The revision ID being viewed. If not given or 0, latest revision is assumed.


See also