Jump to content

Wikipedia:WikiProject User scripts/Scripts/Get user name

From Wikipedia, the free encyclopedia

This is the current revision of this page, as edited by TheDJ (talk | contribs) at 08:28, 5 April 2018 (TheDJ changed the content model of the page Wikipedia:WikiProject User scripts/Scripts/Get user name from "wikitext" to "JavaScript"). The present address (URL) is a permanent link to this version.

(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
/*<pre>*/
/*This script gets a username from the current page
Example: On [[User:Digitalme/getusername.js]], getUserName() would return Digitalme
*/

function getUserName(){
    return mw.config.get('wgRelevantUserName');
}
/*</pre>[[Category:Wikipedia scripts]]*/