Module:Title blacklist

From Bharatpedia, an open encyclopedia
Revision as of 18:02, 14 November 2024 by Muskit Gergous (talk | contribs) (Created page with "--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 args['autoconfirmed'] or "autoconfirmed" else return args['templateeditor'] or "templateeditor" end else return '' end end return p")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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 args['autoconfirmed'] or "autoconfirmed"
		else
			return args['templateeditor'] or "templateeditor"
		end
	else return '' end
end

return p