# ...
function protect() {
global $wgUser;
- if ( Hooks::run( 'ArticleProtect', array( &$this, &$wgUser ) ) ) {
+
+ // Avoid PHP 7.1 warning from passing $this by reference
+ $article = $this;
+
+ if ( Hooks::run( 'ArticleProtect', [ &$article, &$wgUser ] ) ) {
# protect the article
- Hooks::run( 'ArticleProtectComplete', array( &$this, &$wgUser ) );
+ Hooks::run( 'ArticleProtectComplete', [ &$article, &$wgUser ] );
}
}
}
* 1.27+: IApiMessage, or a key or key+parameters in ApiBase::$messageMap.
* Earlier: A key or key+parameters in ApiBase::$messageMap.
+'ApiDeprecationHelp': Add messages to the 'deprecation-help' warning generated
+from ApiBase::addDeprecation().
+&$msgs: Message[] Messages to include in the help. Multiple messages will be
+ joined with spaces.
+
'APIEditBeforeSave': DEPRECATED! Use EditFilterMergedContent instead.
Before saving a page with api.php?action=edit, after
processing request parameters. Return false to let the request fail, returning
$unpatrolled: Whether or not we are showing unpatrolled changes.
$watched: Whether or not the change is watched by the user.
-'ChangesListSpecialPageFilters': Called after building form options on pages
+'ChangesListSpecialPageFilters': DEPRECATED! Use 'ChangesListSpecialPageStructuredFilters'
+instead.
+Called after building form options on pages
inheriting from ChangesListSpecialPage (in core: RecentChanges,
RecentChangesLinked and Watchlist).
$special: ChangesListSpecialPage instance
'ChangesListSpecialPageQuery': Called when building SQL query on pages
inheriting from ChangesListSpecialPage (in core: RecentChanges,
RecentChangesLinked and Watchlist).
+
+Do not use this to implement individual filters if they are compatible with the
+ChangesListFilter and ChangesListFilterGroup structure.
+
+Instead, use sub-classes of those classes, in conjunction with the
+ChangesListSpecialPageStructuredFilters hook.
+
+This hook can be used to implement filters that do not implement that structure,
+or custom behavior that is not an individual filter.
$name: name of the special page, e.g. 'Watchlist'
&$tables: array of tables to be queried
&$fields: array of columns to select
&$join_conds: join conditions for the tables
$opts: FormOptions for this request
+'ChangesListSpecialPageStructuredFilters': Called to allow extensions to register
+filters for pages inheriting from ChangesListSpecialPage (in core: RecentChanges,
+RecentChangesLinked, and Watchlist). Generally, you will want to construct
+new ChangesListBooleanFilter or ChangesListStringOptionsFilter objects.
+
+When constructing them, you specify which group they belong to. You can reuse
+existing groups (accessed through $special->getFilterGroup), or create your own.
+If you create new groups, you must register them with $special->registerFilterGroup.
+$special: ChangesListSpecialPage instance
+
'ChangeTagAfterDelete': Called after a change tag has been deleted (that is,
removed from all revisions and log entries to which it was applied). This gives
extensions a chance to take it off their books.
'ContentHandlerForModelID': Called when a ContentHandler is requested for
a given content model name, but no entry for that model exists in
$wgContentHandlers.
+Note: if your extension implements additional models via this hook, please
+use GetContentModels hook to make them known to core.
$modeName: the requested content model name
&$handler: set this to a ContentHandler object, if desired.
&$url: string value as output (out parameter, can modify)
$query: query options passed to Title::getCanonicalURL()
+'GetContentModels': Add content models to the list of available models.
+&$models: array containing current model list, as strings. Extensions should add to this list.
+
'GetDefaultSortkey': Override the default sortkey for a page.
$title: Title object that we need to get a sortkey for
&$sortkey: Sortkey to use.
context-based variables.
&$lessVars: array of variables already added
+'ResourceLoaderJqueryMsgModuleMagicWords': Called in
+ResourceLoaderJqueryMsgModule to allow adding magic words for jQueryMsg.
+The value should be a string, and they can depend only on the
+ResourceLoaderContext.
+$context: ResourceLoaderContext
+&$magicWords: Associative array mapping all-caps magic word to a string value
+
'ResourceLoaderRegisterModules': Right before modules information is required,
such as when responding to a resource
loader request or generating HTML output.
&$title: If the hook returns false, a Title object to use instead of the
result from the normal query
-'SpecialRecentChangesFilters': DEPRECATED! Use ChangesListSpecialPageFilters
+'SpecialRecentChangesFilters': DEPRECATED! Use ChangesListSpecialPageStructuredFilters
instead.
Called after building form options at RecentChanges.
$special: the special page object
&$extraOpts: array of added items, to which can be added
$opts: FormOptions for this request
-'SpecialRecentChangesQuery': DEPRECATED! Use ChangesListSpecialPageQuery
-instead.
+'SpecialRecentChangesQuery': DEPRECATED! Use ChangesListSpecialPageStructuredFilters
+or ChangesListSpecialPageQuery instead.
Called when building SQL query for SpecialRecentChanges and
SpecialRecentChangesLinked.
&$conds: array of WHERE conditionals for query
$title: The title the 'go' feature has decided to forward the user to
&$url: Initially null, hook subscribers can set this to specify the final url to redirect to
-'SpecialSearchNogomatch': Called when user clicked the "Go" button but the
-target doesn't exist.
+'SpecialSearchNogomatch': Called when the 'Go' feature is triggered (generally
+from autocomplete search other than the main bar on Special:Search) and the
+target doesn't exist. Full text search results are generated after this hook is
+called.
&$title: title object generated from the text entered by the user
'SpecialSearchPowerBox': The equivalent of SpecialSearchProfileForm for
$wgVersion: Current $wgVersion for you to use
&$versionUrl: Raw url to link to (eg: release notes)
-'SpecialWatchlistFilters': DEPRECATED! Use ChangesListSpecialPageFilters
+'SpecialWatchlistFilters': DEPRECATED! Use ChangesListSpecialPageStructuredFilters
instead.
Called after building form options at Watchlist.
$special: the special page object
inserted to rc_type so they can be returned as part of the watchlist.
&$nonRevisionTypes: array of values in the rc_type field of recentchanges table
-'SpecialWatchlistQuery': DEPRECATED! Use ChangesListSpecialPageQuery instead.
+'SpecialWatchlistQuery': DEPRECATED! Use ChangesListSpecialPageStructuredFilters
+or ChangesListSpecialPageQuery instead.
Called when building sql query for SpecialWatchlist.
&$conds: array of WHERE conditionals for query
&$tables: array of tables to be queried