Manual:$wgTitle/pt-br

Detalhes
O objeto Title representa o título de um artigo, e faz todo o trabalho de tradução entre várias formas, como texto puro, URL, chave de banco de dados, etc. Por conveniência, e por razões históricas, também representa algumas características dos artigos que não envolvam seu texto, tais como direitos de acesso.

O objeto Title é inicializado pelo objeto do MediaWiki, $mediaWiki.

A maioria dos lugares no código do MediaWiki tem um título já na mão (ou um título sensato pode ser facilmente criado). Como regra, do not use $wgTitle if it's not absolutely needed. The problem with $wgTitle is that it's not a static global like $wgRequest that always refers to the same object. Instead, $wgTitle can refer to any title at a given point, since you can't anticipate what an extension might have done with it. A good example is in SpecialPages, where you can easily call the getTitle method, which returns a localized version of the special page's title, rather than hoping $wgTitle refers to the special page in question. In short: Do not use it. Ever.

Replacement
Generally one would use a Context object (something that either implements, or subclasses something that implements IContextSource) to get the Title object. Which context object is available varies depending on where your code is being executed:
 * As an example, the Skin class extends ContextSource, so if your code is a method of a subclass of the Skin class, you would use  inside your method to get the current title.
 * If you are in a Skin class, which extends the class  (e.g. the Vector skin does that), you can get the title with.
 * As another example, if you're writing a Tag extension, the third argument to your callback function is the Parser. This is not a ContextSource, but it does have a  method, hence the appropriate way to get the current title from such a callback is.

No replacements
Other things that you may be tempted to do but should be avoided:
 * - Its entirely possible you're doing something in this request related to a Title different from the one actually requested (aka JobQueue, etc). You're probably better off using $wgTitle than doing this.
 * - This is essentially $wgTitle, just dressed up a little, and has all the same drawbacks. If you're desperate you can use this, but you should only do it if you absolutely have to.