wg refers to an important non-constant programming element used in the MediaWiki software, and is an abbreviation for "Wikipedia Global" (the naming pre-dates the spread of MediaWiki beyond Wikipedia).
In general, any global variable (variable that has global scope) within the software has this prefix to make it easily identifiable when programming.
However, a casual hacker will mainly come across such variables in the files
LocalSettings.php, which define variables to control the behavior of the software in various ways.
DefaultSettings.php file stores the defaults for these values and should not be edited; the
LocalSettings file is used to override these values for a specific site — if a particular variable is not mentioned in your
LocalSettings file, copy the entry from
DefaultSettings and amend as appropriate.
Starting with the introduction of the Config class in MediaWiki 1.23, the "wg" prefix for PHP global variables is being phased out as configuration settings are moving away from global scope.
- Manual:Coding conventions/PHP#Variables for other variable prefixes used in MediaWiki.
- Manual:Configuration settings contains a list of all customization settings defined as global variables in MediaWiki. These can be configured in LocalSettings.php.
- Manual:Global object variables - lists some of the main global variables that aren't customization settings.