Manual:Hooks/PageContentInsertComplete

From MediaWiki.org
Jump to: navigation, search
PageContentInsertComplete
Available from version 1.21.0
Occurs after a new article is created
Define function:
public static function onPageContentInsertComplete( $wikiPage, User $user, $content, $summary, $isMinor, $isWatch, $section, $flags, Revision $revision ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"PageContentInsertComplete": "MyExtensionHooks::onPageContentInsertComplete"
	}
}

For MediaWiki ≤1.25:

$wgHooks['PageContentInsertComplete'][] = 'MyExtensionHooks::onPageContentInsertComplete';
Called from: File(s): WikiPage.php

For more information about attaching hooks, see Manual:Hooks.
For examples of extensions using this hook, see Category:PageContentInsertComplete extensions.

  • $wikiPage: WikiPage created
  • $user: User creating the article
  • $content: New content as a Content object
  • $summary: Edit summary/comment
  • $isMinor: Whether or not the edit was marked as minor (new pages can not currently be marked as minor)
  • $isWatch: (No longer used)
  • $section: (No longer used)
  • $flags: Flags passed to WikiPage::doEditContent()
  • $revision: New Revision of the article