Manual:Hooks/PreferencesGetIcon

From Linux Web Expert

PreferencesGetIcon
<translate> Available from <tvar name=1><translate> version <tvar </tvar></translate>
Use the hook to add an icon that will be displayed in the mobile layout of Special:Preferences.
<translate> Define function:</translate>
public static function onPreferencesGetIcon( array &$iconNames ) { ... }
<translate> Attach hook:</translate> <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
	"Hooks": {
		"PreferencesGetIcon": "MediaWiki\\Extension\\MyExtension\\Hooks::onPreferencesGetIcon"
	}
}
<translate> Called from:</translate> <translate> File(s):</translate> specials/forms/PreferencesFormOOUI.php
<translate> Interface:</translate> PreferencesGetIconHook.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:PreferencesGetIcon extensions</tvar>.</translate>


Details

  • array &$iconNames: A key-value array that assigns an icon name to a section name. The key is the section name, the value is the icon name.

Notes

This hook allows extensions or skins to add icons to their section in Special:Preferences's mobile layout.

You can obtain the icon names from OOJS-UI's documentation website.

See also