Manual:Hooks/SkinAfterBottomScripts

From MediaWiki.org
Jump to: navigation, search
SkinAfterBottomScripts
Available from version 1.11.0
At the end of Skin::bottomScripts()
Define function:
public static function onSkinAfterBottomScripts( $skin, &$text ) { ... }
Attach hook:
$wgHooks['SkinAfterBottomScripts'][] = 'MyExtensionHooks::onSkinAfterBottomScripts';
Called from: File(s): Skin.php

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

Details[edit]

  • $skin: Skin object
  • &$text: bottomScripts Text. Append to $text to add additional text/scripts after the stock bottom scripts.

Delete default buttons[edit]

$wgHooks["SkinAfterBottomScripts"][] = "AssetsClass::onSkinAfterBottomScripts";

class AssetsClass {

  public static function onSkinAfterBottomScripts( $skin, &$text ) {

    $text = preg_replace("/^mw\.loader\.using\(\"mediawiki\.action\.edit\"[^\n]+\n/m", "", $text);
    return true;

  }

}