Extension:GetUserName

Category:Extensions without an imageCategory:GPL licensed extensions
MediaWiki extensions manual
GetUserName
Release status: stableCategory:Stable extensions
Implementation Variable Category:Variable extensions
Description Allows the current user's name to be put in a page
Author(s)
Latest version 2.1 (2022-01-02)
Compatibility policy Snapshots releases along with MediaWiki. Master is not backward compatible.Category:Extensions with release branches compatibility policy
MediaWiki 1.35+Category:Extensions with manual MediaWiki version
License GNU General Public License 2.0
Download Category:Extensions in GitHub version control
README
Category:All extensionsCategory:Extensions not in ExtensionJson

The GetUserName extension allows to obtain the current user's name from wgUser and insert it on a page.

Usage

When {{#USERNAME:}} is found in the page, it will replace it with the current user name.

The cache is invalidated for pages using this extension.
In the visual editor, {{#USERNAME}} will evaluate to your current IP address because session information is not preserved when Parsoid parses pages. This also mean template substitution does not work with this tag.

Installation

  • Download and place the file(s) in a directory called GetUserName in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'GetUserName' );
    
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

See also

Category:All extensions Category:Extensions in GitHub version control Category:Extensions not in ExtensionJson Category:Extensions with manual MediaWiki version Category:Extensions with release branches compatibility policy Category:Extensions without an image Category:GPL licensed extensions Category:ParserFirstCallInit extensions Category:Stable extensions Category:Variable extensions