mirror of
https://github.com/diocloid/LinkTitles.git
synced 2025-07-13 09:49:31 +02:00
Use ArticleAfterFetchContentObject hook.
No longer use deprecated ArticleAfterFetchContent hook. The new hook requires MediaWiki 1.21 or later.
This commit is contained in:
@ -38,7 +38,8 @@
|
||||
$wgHooks['PageContentSave'][] = 'LinkTitles::onPageContentSave';
|
||||
};
|
||||
if ( $wgLinkTitlesParseOnRender ) {
|
||||
$wgHooks['ArticleAfterFetchContent'][] = 'LinkTitles::onArticleAfterFetchContent';
|
||||
$wgHooks['ArticleAfterFetchContentObject'][] =
|
||||
'LinkTitles::onArticleAfterFetchContentObject';
|
||||
};
|
||||
$wgHooks['ParserBeforeTidy'][] = 'LinkTitles::removeMagicWord';
|
||||
}
|
||||
@ -56,9 +57,9 @@
|
||||
/// Event handler that is hooked to the ArticleAfterFetchContent event.
|
||||
/// @param $article Article object
|
||||
/// @param $content Content object that holds the article content
|
||||
public static function onArticleAfterFetchContent( &$article, &$content ) {
|
||||
// The ArticleAfterFetchContent event is triggered whenever page content
|
||||
// is retrieved from the database, i.e. also for editing etc.
|
||||
public static function onArticleAfterFetchContentObject( &$article, &$content ) {
|
||||
// The ArticleAfterFetchContentObject event is triggered whenever page
|
||||
// content is retrieved from the database, i.e. also for editing etc.
|
||||
// Therefore we access the global $action variabl to only parse the
|
||||
// content when the page is viewed.
|
||||
global $action;
|
||||
|
Reference in New Issue
Block a user