Manual:Hooks/APIEditBeforeSave/pl

Category:MediaWiki hooks/pl#APIEditBeforeSave Category:Hooks added in MediaWiki 1.13.0/pl#APIEditBeforeSave Category:MediaWiki deprecated or obsolete features/pl#APIEditBeforeSave Category:Hooks removed in MediaWiki 1.34.0/pl#APIEditBeforeSave Category:Hooks deprecated in MediaWiki 1.28.0/pl#APIEditBeforeSave
APIEditBeforeSave
Dostępne od wersji version 1.13.0
Usunięto w version 1.34.0 (Gerrit change 519797)Category:Removed hooks/pl#APIEditBeforeSave
Called right before saving an edit submitted through api.php?action=edit
Zdefiniuj funkcję:
public static function onAPIEditBeforeSave( $editPage, $text, &$resultArr ) { ... }
Dołącz hak: W extension.json:
{
	"Hooks": {
		"APIEditBeforeSave": "MediaWiki\\Extension\\MyExtension\\Hooks::onAPIEditBeforeSave"
	}
}
Called from: Plik(i): api/ApiEditPage.phpCategory:MediaWiki hooks included in ApiEditPage.php#pl
Interface: APIEditBeforeSaveHook.php

For more information about attaching hooks, see Podręcznik:Haki .
For examples of extensions using this hook, see Category:APIEditBeforeSave extensions/pl.

Szczegóły

  • $editPage: the EditPage object
  • $text: the new text of the article (has yet to be saved)
  • $resultArr: data in this array will be added to the API result

Uwagi

Return true to continue processing, return false to abort processing and reject the edit. If $resultArr was filled, the API will return an <edit result="Failure"> element with the contents of $resultArr added in. If $resultArr wasn't filled, the API will return an error message.

Category:Hooks added in MediaWiki 1.13.0/pl Category:Hooks deprecated in MediaWiki 1.28.0/pl Category:Hooks removed in MediaWiki 1.34.0/pl Category:MediaWiki deprecated or obsolete features/pl Category:MediaWiki hooks/pl Category:MediaWiki hooks included in ApiEditPage.php Category:Removed hooks/pl