Manual:Hooks/ChangesListSpecialPageStructuredFilters
ChangesListSpecialPageStructuredFilters | |
---|---|
<translate> Available from <tvar name=1><translate> version <tvar (Gerrit change 337546)</tvar></translate> Called to allow extensions to register filters for pages inheriting from ChangesListSpecialPage (in core: RecentChanges, RecentChangesLinked, and Watchlist). | |
<translate> Define function:</translate> | public static function onChangesListSpecialPageStructuredFilters( ChangesListSpecialPage $special ) { ... }
|
<translate> Attach hook:</translate> | <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
"Hooks": {
"ChangesListSpecialPageStructuredFilters": "MediaWiki\\Extension\\MyExtension\\Hooks::onChangesListSpecialPageStructuredFilters"
}
}
|
<translate> Called from:</translate> | <translate> File(s):</translate> ChangesListSpecialPage.php <translate> Function(s):</translate> ChangesListSpecialPage::registerFilters() |
<translate> Interface:</translate> | ChangesListSpecialPageStructuredFiltersHook.php |
<translate> For more information about attaching hooks, see <tvar name=1>Manual:Hooks </tvar>.</translate>
<translate> For examples of extensions using this hook, see <tvar name=cat>Category:ChangesListSpecialPageStructuredFilters extensions</tvar>.</translate>
Generally, you will want to construct new ChangesListBooleanFilter or ChangesListStringOptionsFilter objects.
When constructing them, you specify which ChangesListFilterGroup they belong to. You can reuse existing groups (accessed through $special->getFilterGroup), or create your own (ChangesListBooleanFilterGroup or ChangesListStringOptionsFilterGroup). If you create new groups, you must register them with $special->registerFilterGroup.
Note that this is called regardless of whether the user is currently using the new (structured) or old (unstructured) filter UI. If you want your boolean filter to show on both the new and old UI, specify all the supported fields. These include showHide, label, and description.
See the constructor of each ChangesList* class for documentation of supported fields.
Details
ChangesListSpecialPage $special
: ChangesListSpecialPage instance