Manual:Hooks/EditFilterMerged/ja
Appearance
This feature was removed from MediaWiki core in version 1.29.0 (after being deprecated in 1.21.0). Please see EditFilterMergedContent for an alternative way to use this feature. |
EditFilterMerged | |
---|---|
Available from version 1.12.0 Removed in version 1.29.0 Post-section-mergeの編集フィルタ | |
Define function: | public static function onEditFilterMerged( $editor, $text, &$error, $summary ) { ... }
|
Attach hook: | In extension.json:
{
"Hooks": {
"EditFilterMerged": "MediaWiki\\Extension\\MyExtension\\Hooks::onEditFilterMerged"
}
}
|
Called from: | File(s): EditPage.php |
Interface: | EditFilterMergedHook.php |
For more information about attaching hooks, see Manual:フック .
For examples of extensions using this hook, see Category:EditFilterMerged extensions/ja.
詳細
[edit]- $editor: EditPageインスタンス (オブジェクト)
- $text: content of the revised article
- &$error: 返すエラーメッセージ (broken until MW 1.16alpha)
- $summary: edit summary provided for edit
注
[edit]- As of MW 1.16alpha (r55681), you have the same two options for filtering edits as with the EditFilter hook:
- 編集を停止するためにfalseを返します; エラーメッセージなどはあなた自身で取り扱う必要があります。
- Return true and modify $error (set to a value other than ''). This will cause the page to stay in edit mode and will cause the contents of $error to be displayed above the edit box. Note: $error should be wikitext.
- In earlier versions, your only option is to return false to halt editing (handling error messages yourself). Setting
$error
will not force the page to stay in edit mode.
$text
is the entire article, after incorporating the submitted text (the contents of the edit box) into the rest of the article; any sections of the article that the editor was not revising have been combined with the submitted text.