User:SamanthaNguyen/Wiki/Historical
Magic words in MediaWiki versions before 1.8
editMediaWiki versions prior to 1.8 differed in the following ways:
- LanguageGetMagic did not pass a language parameter. To simulate this parameter, extensions backported to 1.7 or earlier can extract the language of $wgContLang on their own and proceed as normal and/or offer a language independent process for selecting the ID-text mapping.
- Extensions that used magic words had to explicitly register their magic word IDs using the hook MagicWordMagicWords . This method simply asked the implementer to supply the ID of the magic word.
$wgHooks['MagicWordMagicWords'][] = 'wfAddCustomMagicWord'; function wfAddCustomMagicWord( &$magicWords ) { $magicWords[] = 'MAG_CUSTOM'; #magic word id return true; }