Manual:Hooks/ArticleSave
From MediaWiki.org
| This deprecated feature should no longer be used, but is still available for reasons of backwards compatibility. This feature was deprecated in version 1.21. Please see PageContentSave for an alternative way to use this feature. |
| ArticleSave | |
|---|---|
| Available from version 1.4.0 Occurs whenever the software receives a request to save an article. Can be used to cancel or modify that request. |
|
Define function: |
public static function onArticleSave( &$article, &$user, &$text, &$summary, |
Attach hook: |
$wgHooks['ArticleSave'][] = 'MyExtensionHooks::onArticleSave'; |
| Called from: | WikiPage.php |
For more information about attaching hooks, see Manual:Hooks.
For examples of extensions using this hook, see Category:ArticleSave extensions.
Details [edit]
$article: the article (Article object) being saved$user: the user (User object) saving the article$text: the new article text$summary: the edit summary$minor: minor edit flag$watchthis: watch the page iftrue, unwatch the page iffalse, do nothing ifnull(since 1.17.0)$sectionanchor: not used$flags: bitfield, see documentation for details$status: Status object, see documentation for details (since 1.14.0)
Notes [edit]
- This hook was called from Article.php prior to 1.18 (approximately).
- $status was introduced in 1.14
- $flags was introduced in 1.7
- $minor was passed by reference before 1.7
- $watch and $sectionanchor were in use before 1.7 and were passed by reference
- This hook was called from EditPage and Image before 1.6