Manual:Hooks/ArticleSave
From MediaWiki.org
< Manual:Hooks(Redirected from Manual:MediaWiki hooks/ArticleSave)
| 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: |
function fnMyHook( &$article, &$user, &$text, &$summary, |
*Attach hook: |
$wgHooks['ArticleSave'][] = 'MyExtensionHooks::someExample'; |
| Called from: | WikiPage.php |
*For more information about attaching hooks, see Manual:Hooks.
*For examples of extensions using this hook, see Category:ArticleSave extensions.
[edit] Details
$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
[edit] Notes
- $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.
- This hook was called from Article.php prior to 1.18 (approximately).