Manual:Hooks/PreferencesGetLegend

From MediaWiki.org
Jump to: navigation, search
PreferencesGetLegend
Available from version 1.19.0
Override the text used for the <legend> of a preferences section.

Define function:
public static function onPreferencesGetLegend( $form, $key, &$legend ) { ... }

Attach hook:
$wgHooks['PreferencesGetLegend'][] = 'MyExtensionHooks::onPreferencesGetLegend';
Called from: Preferences.php

For more information about attaching hooks, see Manual:Hooks.
For examples of extensions using this hook, see Category:PreferencesGetLegend extensions.


Details [edit]

  • $form: the PreferencesForm object. This is a ContextSource as well.
  • $key: the section name
  • &$legend: the legend text. Defaults to wfMsg( "prefs-$key" ) but may be overridden