Module:IsRedirect

From Dive Atlas
Revision as of 18:01, 15 July 2013 by wikivoyage>WOSlinker (Created page with "local i = {} function i.IsRedirect(frame) local pagename = frame.args[1]; if pagename == '' then return ''; end local page = mw.title.new(pagena...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Documentation for this module may be created at Module:IsRedirect/doc

local i = {}
 
function i.IsRedirect(frame)
    local pagename = frame.args[1];
    if pagename == '' then
        return '';
    end
    
    local page = mw.title.new(pagename);
    if page.isRedirect then
        return 'yes';
    else
        return '';
    end
end
 
return i;