Manual:Hooks/ArticleSaveComplete
From MediaWiki.org
< Manual:Hooks(Redirected from Manual:MediaWiki hooks/ArticleSaveComplete)
| ArticleSaveComplete | |
|---|---|
| Available from version 1.4.0 Occurs after the save article request has been processed |
|
*Define function: |
function fnMyHook( &$article, &$user, $text, $summary, |
*Attach hook: |
$wgHooks['ArticleSaveComplete'][] = 'MyExtensionHooks::someExample'; |
| Called from: | Article.php |
*For more information about attaching hooks, see Manual:Hooks.
*For examples of extensions using this hook, see Category:ArticleSaveComplete extensions.
[edit] Details
- $article: the article (object) saved
- $user: the user (object) who saved the article
- $text: the new article text
- $summary: the article summary (comment)
- $minoredit: minor flag
- $watchthis: watch the page if
true, unwatch the page iffalse, do nothing ifnull(since 1.17.0) - $section: not used as of 1.8
- $flags: bitfield, see source code for details
- $revision: the new Revision object that was just saved or NULL if the user clicked save without changing any page text (only v1.11.0 and newer).
- $status: the Status object that will be returned by
Article::doEdit()(since 1.14.0) - $baseRevId: revision ID on which this edit is based (since 1.15.0)
- $redirect: if
true, redirect the user back to the page after the edit is successfully committed (since 1.17.0)
The function should return true to continue hook processing or false to abort. This hook will be triggered both by edits made through the edit page, and by edits made through the API.
[edit] Notes
This did not apply to newly uploaded images until v1.4.5.
- Version 1.4.x - 1.5.x: included in EditPage.php and Image.php.
- Version 1.6.x - 1.10.x:included in Article::updateArticle() and Article::insertArticle().
- Version 1.11+: included in Article::doEdit().
- Version 1.18+: moved to WikiPage.php
insertNewArticle() and updateArticle() will watch/unwatch pages after doEdit() (and hence ArticleSaveComplete) are run.