Module:Title blacklist: Difference between revisions
Appearance
Content deleted Content added
←Created page with '--helper module for title blacklist local p = {} p.main = function(frame) local args = require('Module:Arguments').getArgs(frame) local action = args['action'] local pagename = args['pagename'] local blacklistentry = mw.ext.TitleBlacklist.test(action, pagename) if blacklistentry then if blacklistentry.params.autoconfirmed then return "autoconfirmed users" else return "template editors, [[WP:SYSOP|administrators...' |
No edit summary |
||
Line 3: | Line 3: | ||
local p = {} |
local p = {} |
||
p.main = function(frame) |
p.main = function(frame) |
||
local args = |
local args = frame.args |
||
local action = args['action'] |
local action = args['action'] |
||
local pagename = args['pagename'] |
local pagename = args['pagename'] |
Revision as of 14:59, 9 November 2023
![]() | This Lua module is used in system messages. Changes to it can cause immediate changes to the Wikipedia user interface. To avoid major disruption, any changes should be tested in the module's /sandbox or /testcases subpages, or in your own module sandbox. The tested changes can be added to this page in a single edit. Please discuss changes on the talk page before implementing them. |
![]() | This module can only be edited by administrators because it is transcluded onto one or more cascade-protected pages. |
Helper module to get protection data about a blacklisted page entry.
Usage
{{#invoke:Title blacklist|main|action=edit|pagename=Example}}
-> "templateeditor", "autoconfirmed", or the empty string.
{{#invoke:Title blacklist|main|action=edit|pagename=Example|templateeditor=Example1|autoconfirmed=Example2}}
-> "Example1", "Example2", or the empty string.
--helper module for title blacklist
local p = {}
p.main = function(frame)
local args = frame.args
local action = args['action']
local pagename = args['pagename']
local blacklistentry = mw.ext.TitleBlacklist.test(action, pagename)
if blacklistentry then
if blacklistentry.params.autoconfirmed then
return "[[WP:AUTOCONFIRMED|autoconfirmed users]]"
else
return "[[WP:TE|template editors]], [[WP:SYSOP|administrators]], and [[WP:PAGEMOVER|page movers]]"
end
end
end
return p