From 1051f68e7d438d20df44fd9386a0a451e77fbb8e Mon Sep 17 00:00:00 2001 From: Brian Wolff Date: Wed, 11 Dec 2013 14:59:48 -0700 Subject: [PATCH] Add $context to the ArticleFromTitle hook Most of the time people wouldn't need this - this hook is mostly used to inject a custom Article subclass for a specific namespace to do fancy things, but lets give users the most flexibility. Asked for by leaves on irc. Change-Id: I3386ff4abe0e5b3eb783604ae222b7703428db44 --- docs/hooks.txt | 1 + includes/Article.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/hooks.txt b/docs/hooks.txt index 3f1152ba87..4a43359f75 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -541,6 +541,7 @@ $wikiPage: WikiPage (object) being modified Wiki::articleFromTitle(). $title: Title (object) used to create the article object $article: Article (object) that will be returned +$context: IContextSource (object) 'ArticleInsertComplete': After a new article is created. DEPRECATED, use PageContentInsertComplete. diff --git a/includes/Article.php b/includes/Article.php index 85a34dba37..e0396a19e5 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -158,7 +158,7 @@ class Article implements Page { } $page = null; - wfRunHooks( 'ArticleFromTitle', array( &$title, &$page ) ); + wfRunHooks( 'ArticleFromTitle', array( &$title, &$page, $context ) ); if ( !$page ) { switch ( $title->getNamespace() ) { case NS_FILE: -- 2.20.1