Manual:Hooks/EditFilterMergedContent

EditFilterMergedContent
Available from version 1.21.0
Post-section-merge edit filter.
Define function:
public static function onEditFilterMergedContent( $context, $content, $status, $summary, $user, $minoredit ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"EditFilterMergedContent": "MediaWiki\\Extension\\MyExtension\\Hooks::onEditFilterMergedContent"
	}
}
Called from: File(s): EditPage.php
Interface: EditFilterMergedContentHook.php

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


This may be triggered by the EditPage or any other facility that modifies page content. Use the $status object to indicate whether the edit should be allowed, and to provide a reason for disallowing it. Return false to abort the edit, and true to continue. Returning true if $status->isOK() returns false means "don't save but continue user interaction", e.g. show the edit form.

Details

edit
  • $context: object implementing the IContextSource interface.
  • $content: content of the edit box, as a Content object.
  • $status: Status object to represent errors, etc.
  • $summary: Edit summary for page
  • $user: the User object representing the user whois performing the edit.
  • $minoredit: whether the edit was marked as minor by the user.