Index: trunk/phase3/docs/hooks.txt |
— | — | @@ -1743,6 +1743,10 @@ |
1744 | 1744 | $title: The title in question. |
1745 | 1745 | &$types: The types of protection available. |
1746 | 1746 | |
| 1747 | +'TitleIsCssOrJsPage': Called when determining if a page is a CSS or JS page |
| 1748 | +$title: Title object that is being checked |
| 1749 | +$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() |
| 1750 | + |
1747 | 1751 | 'TitleMoveComplete': after moving an article (title) |
1748 | 1752 | $old: old title |
1749 | 1753 | $nt: new title |
Index: trunk/phase3/includes/Title.php |
— | — | @@ -1949,8 +1949,10 @@ |
1950 | 1950 | * @return Bool |
1951 | 1951 | */ |
1952 | 1952 | public function isCssOrJsPage() { |
1953 | | - return $this->mNamespace == NS_MEDIAWIKI |
| 1953 | + $retval = $this->mNamespace == NS_MEDIAWIKI |
1954 | 1954 | && preg_match( '!\.(?:css|js)$!u', $this->mTextform ) > 0; |
| 1955 | + wfRunHooks( 'TitleIsCssOrJsPage', array( $this, &$retval ) ); |
| 1956 | + return $retval; |
1955 | 1957 | } |
1956 | 1958 | |
1957 | 1959 | /** |