MediaWiki master
MediaWiki\Hook\GetLocalURLHook Interface Reference

This is a hook handler interface, see docs/Hooks.md. More...

Inherited by MediaWiki\HookContainer\HookRunner.

Public Member Functions

 onGetLocalURL ( $title, &$url, $query)
 Use this hook to modify local URLs as output into page links.
 

Detailed Description

This is a hook handler interface, see docs/Hooks.md.

Use the hook name "GetLocalURL" to register handlers implementing this interface.

Stability: stable
to implement

Definition at line 14 of file GetLocalURLHook.php.

Member Function Documentation

◆ onGetLocalURL()

MediaWiki\Hook\GetLocalURLHook::onGetLocalURL ( $title,
& $url,
$query )

Use this hook to modify local URLs as output into page links.

Note that if you are working with internal urls (non-interwiki) then it may be preferable to work with the GetLocalURL::Internal or GetLocalURL::Article hooks as GetLocalURL can be buggy for internal URLs on render if you do not re-implement the horrible hack that Title::getLocalURL uses in your own extension.

Since
1.35
Parameters
Title$titleTitle object of page
string&$urlString value as output (out parameter, can modify)
string$queryQuery options as string passed to Title::getLocalURL()
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: