Open main menu
This page is a translated version of the page Manual:Hooks/AutopromoteCondition and the translation is 50% complete.

Other languages:
English • ‎中文 • ‎日本語
version 1.12.0 版可用
check autopromote condition for user.
public static function onAutopromoteCondition( $type, $args, $user, &$result ) { ... }

In extension.json:

	"Hooks": {
		"AutopromoteCondition": "MyExtensionHooks::onAutopromoteCondition"

For MediaWiki ≤1.25:

$wgHooks['AutopromoteCondition'][] = 'MyExtensionHooks::onAutopromoteCondition';
调用自:文件: Autopromote.php

有关使用此钩子的扩展示例,请参见Category:AutopromoteCondition extensions/zh


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: 条件类型
  • $args: 参数
  • $user: 用户
  • &$result: result of checking autopromote condition. Defaults to null; if left as null, will throw an exception ("unrecognized condition [$type] for autopromotion")