From a18953f97af63e9127cee330af40d24893f41c12 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bartosz=20Dziewo=C5=84ski?= Date: Fri, 29 Aug 2014 23:07:09 +0200 Subject: [PATCH] Add SkinPreloadExistence hook Bug: 69650 Change-Id: Ia16c2034cdf6cdc9ac8e37b113ffbbecd272087f --- RELEASE-NOTES-1.24 | 2 ++ docs/hooks.txt | 5 +++++ includes/skins/Skin.php | 2 ++ 3 files changed, 9 insertions(+) diff --git a/RELEASE-NOTES-1.24 b/RELEASE-NOTES-1.24 index aea6ec5451..c13ea9dd24 100644 --- a/RELEASE-NOTES-1.24 +++ b/RELEASE-NOTES-1.24 @@ -181,6 +181,8 @@ production. * API token handling has been rewritten. Any API module using tokens will need to be updated. See the entry below under "Action API internal changes". * Added HTMLAutoCompleteSelectField. +* Added a new hook, "SkinPreloadExistence", to allow extensions to add titles to + link existence cache before the page is rendered. === Bug fixes in 1.24 === * (bug 50572) MediaWiki:Blockip should support gender diff --git a/docs/hooks.txt b/docs/hooks.txt index 82da289324..92497b2d61 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -2292,6 +2292,11 @@ $type: 'normal' or 'history' for old/diff views the MediaWiki icon but plain text instead. $skin: Skin object +'SkinPreloadExistence': Supply titles that should be added to link existence +cache before the page is rendered. +&$titles: Array of Title objects +$skin: Skin object + 'SkinSubPageSubtitle': At the beginning of Skin::subPageSubtitle(). &$subpages: Subpage links HTML $skin: Skin object diff --git a/includes/skins/Skin.php b/includes/skins/Skin.php index dc06ebaa24..7d04b9551f 100644 --- a/includes/skins/Skin.php +++ b/includes/skins/Skin.php @@ -253,6 +253,8 @@ abstract class Skin extends ContextSource { $titles[] = $this->getTitle()->getTalkPage(); } + wfRunHooks( 'SkinPreloadExistence', array( &$titles, $this ) ); + $lb = new LinkBatch( $titles ); $lb->setCaller( __METHOD__ ); $lb->execute(); -- 2.20.1