Jump to content

User:SamanthaNguyen/Wiki/Historical

From mediawiki.org

Magic words in MediaWiki versions before 1.8

[edit]

MediaWiki versions prior to 1.8 differed in the following ways:

  1. 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.
  2. 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;
    }