Extension:MobileFrontend/Hooks/EnterMobileMode

From mediawiki.org
EnterMobileMode
Available from version 1.22.0 (Gerrit change 57060)
A hook that runs at the point the mobile site initializes.
Define function:
public static function onEnterMobileMode( MobileContext $mobileContext ) { ... }
Attach hook:
$wgHooks['EnterMobileMode'][] = 'MyExtensionHooks::onEnterMobileMode';
Called from:File(s): MobileFrontend / includes/MobileContext.php
Function(s): shouldDisplayMobileView

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

Parameters[edit]

  • $mobileContext: An instance of MobileContext, which represents an extended class of ContextSource. It allows you to check the mode of mobile ('beta' or 'stable') by calling MobileContext::isBetaGroupMember().