From: Bartosz DziewoƄski Date: Fri, 29 Aug 2014 21:07:09 +0000 (+0200) Subject: Add SkinPreloadExistence hook X-Git-Tag: 1.31.0-rc.0~14177^2 X-Git-Url: http://git.cyclocoop.org/%22.%24image2.%22?a=commitdiff_plain;h=a18953f97af63e9127cee330af40d24893f41c12;p=lhc%2Fweb%2Fwiklou.git Add SkinPreloadExistence hook Bug: 69650 Change-Id: Ia16c2034cdf6cdc9ac8e37b113ffbbecd272087f --- 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();