MediaWiki REL1_35
MediaWiki\Hook\CanonicalNamespacesHook Interface Reference

Stable to implement. More...

Inheritance diagram for MediaWiki\Hook\CanonicalNamespacesHook:

Public Member Functions

 onCanonicalNamespaces (&$namespaces)
 Use this hook to add namespaces or alter the defaults.

Detailed Description

Stable to implement.

Definition at line 9 of file CanonicalNamespacesHook.php.

Member Function Documentation

◆ onCanonicalNamespaces()

MediaWiki\Hook\CanonicalNamespacesHook::onCanonicalNamespaces ( $namespaces)

Use this hook to add namespaces or alter the defaults.

Note that if you need to specify namespace protection or content model for a namespace that is added in a CanonicalNamespaces hook handler, you should do so by altering $wgNamespaceProtection and $wgNamespaceContentModels outside the handler, in top-level scope. The point at which the CanonicalNamespaces hook fires is too late for altering these variables. This applies even if the namespace addition is conditional; it is permissible to declare a content model and protection for a namespace and then decline to actually register it.

string[]&$namespacesArray of namespace numbers with corresponding canonical names
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: