Jump to content

手册:钩子/AutopromoteCondition

From mediawiki.org
This page is a translated version of the page Manual:Hooks/AutopromoteCondition and the translation is 50% complete.
AutopromoteCondition
version 1.12.0 版可用
check autopromote condition for user.
定义函数:
public static function onAutopromoteCondition( $type, $args, $user, &$result ) { ... }
附加钩子: extension.json中:
{
	"Hooks": {
		"AutopromoteCondition": "MediaWiki\\Extension\\MyExtension\\Hooks::onAutopromoteCondition"
	}
}
调用自: 文件: Autopromote.php
介面: AutopromoteConditionHook.php

更多有关附加钩子的信息,请参见Manual:Hooks
有关使用此钩子的扩展示例,请参见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")