手册:钩子/AutopromoteCondition

From MediaWiki.org
Jump to navigation Jump to search
This page is a translated version of the page Manual:Hooks/AutopromoteCondition and the translation is 50% complete.

Other languages:
English • ‎中文 • ‎日本語
AutopromoteCondition
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")