Add SkinPreloadExistence hook
authorBartosz Dziewoński <matma.rex@gmail.com>
Fri, 29 Aug 2014 21:07:09 +0000 (23:07 +0200)
committerBartosz Dziewoński <matma.rex@gmail.com>
Wed, 3 Sep 2014 18:09:00 +0000 (20:09 +0200)
Bug: 69650
Change-Id: Ia16c2034cdf6cdc9ac8e37b113ffbbecd272087f

RELEASE-NOTES-1.24
docs/hooks.txt
includes/skins/Skin.php

index aea6ec5..c13ea9d 100644 (file)
@@ -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
index 82da289..92497b2 100644 (file)
@@ -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
index dc06eba..7d04b95 100644 (file)
@@ -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();