Manual:Hooks/SpecialPage initList

Use cases
MediaWiki installations use the  hook when they want to add to or remove pages from the special page list. They can use this to:


 * dynamically add special pages from a database or other resource
 * remove undesirable built-in special pages from the default list
 * enable context dependent list of special pages - e.g. lists that depend on current server load, user's access method (local host, VPN, public internet)
 * replace the default class associated with a special page with a custom subclass
 * limit access to special pages based on user identity even in cases where the special page is not permissions aware

Background
A special page is a "virtual" MediaWiki article. Instead of being loaded from a file or database like a normal MediaWiki page, its content is generated on the fly using PHP code.

By default, MediaWiki builds the list of special pages from two sources: a list of builtin special pages hard coded into the MediaWiki core and the configuration variable $wgSpecialPages. As a final step, MediaWiki passes the default list to all the functions attached to the.

Usage
Functions attached to this hook add and remove elements from. This array has the same structure as $wgSpecialPages.

The hook function should return  so as not to interfere with other functions that might be attached to this hook.