This is a hook handler interface, see docs/Hooks.md.
More...
This is a hook handler interface, see docs/Hooks.md.
Use the hook name "SpecialPage_initList" to register handlers implementing this interface.
- Stability: stable
- to implement
Definition at line 13 of file SpecialPage_initListHook.php.
◆ onSpecialPage_initList()
MediaWiki\SpecialPage\Hook\SpecialPage_initListHook::onSpecialPage_initList |
( |
& |
$list | ) |
|
This hook is called when setting up SpecialPageFactory::$list.
Use this hook to remove a core special page or conditionally register special pages.
- Note
- The existence of a special page must not depend on the request context (e.g. current user or current title). Possible red/blue links from wiki pages are cached in the parser cache and must be stable across the requests from different users or for different pages. Use only site config or checks if extensions are loaded to add or remove special pages from the list. Override SpecialPage::userCanExecute or set a user right when calling SpecialPage::__construct, after registering the special page for all users, to restrict the access for users allowed to use the page. When replacing a (core) special page in the list, it is possible to depend on the request context, but this hook is also called from Setup and the the user is not always safe to load, call User::isSafeToLoad before using any User class function or one of the user services like UserOptionsLookup/UserOptionsManager. Also the title may not be set for all requests (for e.g. api.php or load.php), so checks for title should be avoided.
- Since
- 1.35
- Parameters
-
array | &$list | List of core special pages, mapping of (canonical) page name to class name, factory callback or to ObjectFactory spec |
- Returns
- bool|void True or no return value to continue or false to abort
Implemented in MediaWiki\HookContainer\HookRunner.
The documentation for this interface was generated from the following file: