Module:Taxonbar/exists

From OODA WIKI

About

Checks the page for transclusions of {{Taxonbar}} and its redirects.

Usage

{{Taxonbar/exists}}

See also



local p = {}

function p.check( frame )
	local pagename = mw.title.getCurrentTitle().baseText
	local content = mw.title.new(pagename):getContent() or ''
	local getRegex = require('Module:Template redirect regex').main
	local tregex = getRegex('Taxonbar')
	for _, v in pairs (tregex) do
		local found = string.match(content, v)
		if found then return true end
	end
	return false
end

return p