public static function onGetDefaultSortkey( $title, &$sortkey ) { ... }Attach hook: In extension.json:
{ "Hooks": { "GetDefaultSortkey": "MediaWiki\\Extension\\MyExtension\\Hooks::onGetDefaultSortkey" } }Called from: File(s): Title.php Interface: GetDefaultSortkeyHook.php
For more information about attaching hooks, see Manual:Hooks .
For examples of extensions using this hook, see Category:GetDefaultSortkey extensions.
$title
: A Title object representing the page in question&$sortkey
: What sortkey to use unless a custom one is specified. If a custom sortkey was specified, this value would be used as a tie breaker for the specified sortkey.After adding an extension that uses this hook, you should run php updateCollation.php --force
to re-sort any existing category entries. What the default sortkey for a page is, is not stored in the DB, so things won't get updated until the category is removed and re-added to a page, or the maintenance script is run.
This should not use any information that could change other than the title object, because such sortkeys are only re-calculated on page moves or if the category is removed and re-added.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4