Open main menu

Extension:GetUserName

Other languages:
English • ‎magyar • ‎polski • ‎中文 • ‎日本語
MediaWiki extensions manual
OOjs UI icon advanced.svg
GetUserName
Release status: stable
Implementation Variable
Description Allows the current user's name to be put in a page
Author(s) Antoine Mercier-Linteau, Ejcaputo
Latest version 2.0 (2019-10-06)
MediaWiki 1.31+
License GNU General Public License 2.0
Download
Translate the GetUserName extension if it is available at translatewiki.net
Check usage and version matrix.

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

UsageEdit

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 (see Extension talk:GetUserName page).

InstallationEdit

  • 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:
    wfLoadExtension( 'GetUserName' );
    
  •   Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

To users running MediaWiki 1.24 or earlier:

The instructions above describe the new way of installing this extension using wfLoadExtension(). If you need to install this extension on these earlier versions (MediaWiki 1.24 and earlier), instead of wfLoadExtension( 'GetUserName' );, you need to use:

require_once "$IP/extensions/GetUserName/GetUserName.php";

See alsoEdit