Manual:Hooks/RandomPageQuery

From Linux Web Expert

RandomPageQuery
<translate> Available from <tvar name=1><translate> version <tvar </tvar></translate>
Modify the query used by Special:Random
<translate> Define function:</translate>
public static function onRandomPageQuery( &$tables, &$conds, &$joinConds ) { ... }
<translate> Attach hook:</translate> <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
	"Hooks": {
		"RandomPageQuery": "MediaWiki\\Extension\\MyExtension\\Hooks::onRandomPageQuery"
	}
}
<translate> Called from:</translate> <translate> File(s):</translate> specials/SpecialRandompage.php
<translate> Interface:</translate> RandomPageQueryHook.php

<translate> For more information about attaching hooks, see <tvar name=1>Manual:Hooks </tvar>.</translate>
<translate> For examples of extensions using this hook, see <tvar name=cat>Category:RandomPageQuery extensions</tvar>.</translate>

Details

Allows extensions to modify the query used by Special:Random.

  • &$tables: Database tables to be used in the query
  • &$conds: Conditions to be applied in the query
  • &$joinConds: Join conditions to be applied in the query