Manual:Hooks/ChangeTagsListActive
ChangeTagsListActive | |
---|---|
Available from version 1.25.0 Can be used by extensions to register active change tags. | |
Define function: | public static function onChangeTagsListActive( &$tags ) { ... }
|
Attach hook: | In extension.json:
{
"Hooks": {
"ChangeTagsListActive": "MediaWiki\\Extension\\MyExtension\\Hooks::onChangeTagsListActive"
}
}
|
Called from: | File(s): ChangeTags.php |
Interface: | ChangeTagsListActiveHook.php |
For more information about attaching hooks, see Manual:Hooks .
For examples of extensions using this hook, see Category:ChangeTagsListActive extensions.
Details
edit- &$tags: The list of tags. Add active tags (those change tags still in use) to this array.
Notes
editThis hook should be used to register tags that are still "active" or "in use".
"Active" or "in use" means that the tag will be applied to future edits or log entries. For example, an extension that applies a tag to every edit from a mobile device would register that tag as "active". However, tags applied only by disabled abuse filters would not be considered "active", because they will not be applied to any future edits unless the relevant filter is re-enabled.
Any tags registered as active by this hook should also be defined using the ListDefinedTags hook.
Extensions that just use one or two hard-coded tags will normally be able to use the same function to implement both this hook and the ListDefinedTags hook.
Example
editSee example at Manual:Hooks/ListDefinedTags.