Manual:Hooks/AutopromoteCondition/de-formal

From Linux Web Expert

The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
AutopromoteCondition
<translate> Available from <tvar name=1><translate> version <tvar </tvar></translate>
check autopromote condition for user.
<translate> Define function:</translate>
public static function onAutopromoteCondition( $type, $args, $user, &$result ) { ... }
<translate> Attach hook:</translate> <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
	"Hooks": {
		"AutopromoteCondition": "MediaWiki\\Extension\\MyExtension\\Hooks::onAutopromoteCondition"
	}
}
<translate> Called from:</translate> <translate> File(s):</translate> Autopromote.php
<translate> Interface:</translate> AutopromoteConditionHook.php

<translate> For more information about attaching hooks, see <tvar name=1>Manual:Hooks </tvar>.</translate>
<translate> For examples of extensions using this hook, see <tvar name=cat>Category:AutopromoteCondition extensions/de-formal</tvar>.</translate>

Details

This hook only runs if the condition type does not match any of those already defined as possible conditions. If you are writing an extension that declares a constant for a new condition type, note that values 0 through 9 have already been taken by APCOND_EDITCOUNT, APCOND_AGE, etc.

  • $type - condition type
  • $args - arguments
  • $user - user
  • &$result - result of checking autopromote condition. Defaults to null; if left as null, will throw an exception ("unrecognized condition [$type] for autopromotion")