Movatterモバイル変換


[0]ホーム

URL:


Jump to content
MediaWiki
Search

Manual:Hooks/TitleMoveComplete

From mediawiki.org
<Manual:Hooks
WarningWarning:For MediaWiki 1.27 and higher the third parameter needs to be declared as$user and not&$user. This is a known bug; seephab:T118683 for details. (If your hook function does not modify theUser object, you can simply change the parameter to$user and it will work correctly across all MediaWiki versions.)
This feature was removed from MediaWiki core in version 1.37.0 (after being deprecated in 1.35.0).Please seePageMoveComplete for an alternative way to use this feature.
TitleMoveComplete
Available from version 1.4.0
Removed inversion 1.37.0 (Gerrit change 678414)
Occurs whenever a request to move an article is completed, after the database transaction commits.
Define function:
publicstaticfunctiononTitleMoveComplete(Title&$title,Title&$newTitle,User&$user,$oldid,$newid,$reason,Revision$revision){...}
Attach hook:Inextension.json:
{"Hooks":{"TitleMoveComplete":"MediaWiki\\Extension\\MyExtension\\Hooks::onTitleMoveComplete"}}
Called from:File(s):MovePage.php
Function(s): MovePage::move()
Interface:TitleMoveCompleteHook.php

For more information about attaching hooks, seeManual:Hooks.
For examples of extensions using this hook, seeCategory:TitleMoveComplete extensions.

Details

[edit]
  • $title: oldTitle
  • $newTitle: newTitle
  • $user: User who did the move
  • $oldid: databasepage_id of the page that's been moved
  • $newid: databasepage_id of the created redirect, or 0 if the redirect was suppressed.
  • $reason: reason for the move; added ingit #6f106156 (version 1.23)
  • $revision: revision created by the move; added ingit #9cc2f62b (version 1.27)

See also

[edit]
Retrieved from "https://www.mediawiki.org/w/index.php?title=Manual:Hooks/TitleMoveComplete&oldid=6898432"
Categories:

[8]ページ先頭

©2009-2025 Movatter.jp