Open main menu

Extension:MobileFrontend/EnterMobileMode

EnterMobileMode
Available from version master (Gerrit change 57060)
Called when entering the mobile view.
Define function:
public static function onEnterMobileMode( no arguments ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"EnterMobileMode": "MyExtensionHooks::onEnterMobileMode"
	}
}

For MediaWiki ≤1.25:

$wgHooks['EnterMobileMode'][] = 'MyExtensionHooks::onEnterMobileMode';
Called from:File(s): MobileFrontend extension/MobileContext.php

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

DetailsEdit

Called, when MobileFrontend enters the mobile mode (e.g. because of a mobile url, mobile device or useformat=mobile URL parameter) and can be used to get the information, that the request will be handled as a "mobile" request. Primacy is given to the page action - it will never show mobile view for page edits or page history.