Module:title/getCurrentTitle

Hello, you have come here looking for the meaning of the word Module:title/getCurrentTitle. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:title/getCurrentTitle, but we will also tell you about its etymology, its characteristics and you will know how to say Module:title/getCurrentTitle in singular and plural. Everything you need to know about the word Module:title/getCurrentTitle you have here. The definition of the word Module:title/getCurrentTitle will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:title/getCurrentTitle, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.


local get_current_title = mw.title.getCurrentTitle

--[==[
A modified version of {mw.title.getCurrentTitle}, which returns the title object for the current title. If the additional optional parameter {fragment} is given, the returned title object will have that value as the fragment, which is the part of the title that comes after {#}, referring to a specific section on the page (e.g. in {"foo#bar"}, the fragment is {"bar"}).

This is a convenience function, which is generally only useful when dealing with fragment-only links, as these resolve to other sections on the current page (e.g. ] is a link to the section "foo" on the current page). If the {fragment} parameter is not needed, it is more efficient to simply call {mw.title.getCurrentTitle} directly.]==]
return function(fragment)
	if fragment == nil then
		return get_current_title()
	end
	local current_title = get_current_title()
	current_title.fragment = fragment
	return current_title
end