Manual:Hooks/APIEditBeforeSave/ja

From MediaWiki.org
Jump to: navigation, search
APIEditBeforeSave
Available from version 1.13.0
api.php?action=editを通して投稿された編集を保存する直前に呼び出されます

*Define function:
function fnMyHook(&$editPage, $text, &$resultArr) { ... }

*Attach hook:
$wgHooks['APIEditBeforeSave'][] = 'fnMyHook';
Called from: ApiEditPage.php

*For more information about attaching hooks, see Manual:Hooks/ja.
*For examples of extensions using this hook, see Category:APIEditBeforeSave extensions/ja.


詳細 [edit]

  • $editPage: EditPageオブジェクト
  • $text: 記事の新しいテキスト(未保存)
  • $resultArr: 配列のデータはAPIの結果に追加される

[edit]

処理を続けるためにはtrueを、処理を中断して編集を拒否するためにfalseを返します。$resultArrが満たされていた場合、アドインされた$resultArrの内容を持つ<edit result="Failure">要素を返します。$resultArrが満たされていなかった場合、APIはエラーメッセージを返します。

言語: English  • 日本語