Manual:Hooks/TitleIsCssOrJsPage

From MediaWiki.org
Jump to navigation Jump to search
TitleIsCssOrJsPage
Available from version 1.19.0 (r93759)
Removed in version 1.29.0
Called when determining if a page is a CSS or JS page.
Define function:
public static function onTitleIsCssOrJsPage( $title, &$result ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"TitleIsCssOrJsPage": "MyExtensionHooks::onTitleIsCssOrJsPage"
	}
}

For MediaWiki ≤1.25:

$wgHooks['TitleIsCssOrJsPage'][] = 'MyExtensionHooks::onTitleIsCssOrJsPage';
Called from:File(s): Title.php
Function(s): Title::isCssOrJsPage()

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

Details[edit]

  • $title: Title object that is being checked
  • &$result: Boolean; whether MediaWiki currently thinks this is a CSS/JS page. Hooks may change this value to override the return value of Title::isCssOrJsPage()