Manual:Hooks/TitleGetRestrictionTypes

From Linux Web Expert

TitleGetRestrictionTypes
<translate> Available from <tvar name=1><translate> version <tvar </tvar></translate>
Allows to modify the types of protection that can be applied.
<translate> Define function:</translate>
public static function onTitleGetRestrictionTypes( $title, &$types ) { ... }
<translate> Attach hook:</translate> <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
	"Hooks": {
		"TitleGetRestrictionTypes": "MediaWiki\\Extension\\MyExtension\\Hooks::onTitleGetRestrictionTypes"
	}
}
<translate> Called from:</translate> <translate> File(s):</translate> Title.php
<translate> Interface:</translate> TitleGetRestrictionTypesHook.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:TitleGetRestrictionTypes extensions</tvar>.</translate>


Details

  • $title: The title in question.
  • &$types: The types of protection available.