mirror of
https://github.com/diocloid/LinkTitles.git
synced 2025-07-13 17:59:29 +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';
|
$wgHooks['PageContentSave'][] = 'LinkTitles::onPageContentSave';
|
||||||
};
|
};
|
||||||
if ( $wgLinkTitlesParseOnRender ) {
|
if ( $wgLinkTitlesParseOnRender ) {
|
||||||
$wgHooks['ArticleAfterFetchContent'][] = 'LinkTitles::onArticleAfterFetchContent';
|
$wgHooks['ArticleAfterFetchContentObject'][] =
|
||||||
|
'LinkTitles::onArticleAfterFetchContentObject';
|
||||||
};
|
};
|
||||||
$wgHooks['ParserBeforeTidy'][] = 'LinkTitles::removeMagicWord';
|
$wgHooks['ParserBeforeTidy'][] = 'LinkTitles::removeMagicWord';
|
||||||
}
|
}
|
||||||
@ -56,9 +57,9 @@
|
|||||||
/// Event handler that is hooked to the ArticleAfterFetchContent event.
|
/// Event handler that is hooked to the ArticleAfterFetchContent event.
|
||||||
/// @param $article Article object
|
/// @param $article Article object
|
||||||
/// @param $content Content object that holds the article content
|
/// @param $content Content object that holds the article content
|
||||||
public static function onArticleAfterFetchContent( &$article, &$content ) {
|
public static function onArticleAfterFetchContentObject( &$article, &$content ) {
|
||||||
// The ArticleAfterFetchContent event is triggered whenever page content
|
// The ArticleAfterFetchContentObject event is triggered whenever page
|
||||||
// is retrieved from the database, i.e. also for editing etc.
|
// content is retrieved from the database, i.e. also for editing etc.
|
||||||
// Therefore we access the global $action variabl to only parse the
|
// Therefore we access the global $action variabl to only parse the
|
||||||
// content when the page is viewed.
|
// content when the page is viewed.
|
||||||
global $action;
|
global $action;
|
||||||
|
Reference in New Issue
Block a user