Manual:Hooks/GetCanonicalURL

From MediaWiki.org
Jump to: navigation, search
GetCanonicalURL
Available from version 1.18.0 (r94995)
Allows to modify fully-qualified URLs used for IRC and e-mail notifications.

Define function:
public static function onGetCanonicalURL( $title, $url, $query, $variant ) { ... }

Attach hook:
$wgHooks['GetCanonicalURL'][] = 'MyExtensionHooks::onGetCanonicalURL';
Called from: Title.php

For more information about attaching hooks, see Manual:Hooks.
For examples of extensions using this hook, see Category:GetCanonicalURL extensions.


[edit] Details

  • $title: Title object of page
  • $url: string value as output (out parameter, can modify)
  • $query: query options passed to Title::getCanonicalURL()
  • $variant: variant passed to Title::getCanonicalURL()
Personal tools
Namespaces

Variants
Actions
Navigation
Support
Download
Development
Communication
Print/export
Toolbox