Jump to content

Module:Title blacklist/sandbox: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Create sandbox version of Module:Title blacklist
 
No edit summary
 
Line 2: Line 2:


local p = {}
local p = {}
p.main = function(frame)
p._main = function(args)
local args = frame.args
local action = args['action']
local action = args['action']
local pagename = args['pagename']
local pagename = args['pagename']
Line 14: Line 13:
end
end
else return '' end
else return '' end
end

p.main = function(frame)
local args = frame.args
return p._main(args)
end
end



Latest revision as of 17:32, 22 March 2024

--helper module for title blacklist

local p = {}
p._main = function(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 args['autoconfirmed'] or "autoconfirmed"
		else
			return args['templateeditor'] or "templateeditor"
		end
	else return '' end
end

p.main = function(frame)
	local args = frame.args
	return p._main(args)
end

return p