Manual:Hooks/APIEditBeforeSave/pl
Appearance
Ta funkcja została usunięta z jądra MediaWiki w wersji 1.34.0 (po wycofaniu w 1.28.0).
Proszę zobaczyć alternatywny sposób użycia tej funkcji na EditFilterMergedContent. |
| APIEditBeforeSave | |
|---|---|
| Dostępne od wersji version 1.13.0 Usunięto w version 1.34.0 (Gerrit change 519797) 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.php |
| 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.