jenkins-bot has submitted this change and it was merged.

Change subject: Register the staff edit change tag and mark it as active
......................................................................


Register the staff edit change tag and mark it as active

This allows users to visit Special:Tags or use the API to see
which change tags are defined and in active use.

The ChangeTagsListActive hook was introduced to core in
I77f476c8d0f32c80f720aa2c5e66869c81faa282

Change-Id: I11ecfd65b5ad320d56e86f502dc9e40192c7d212
---
M StaffEdits.class.php
M StaffEdits.php
2 files changed, 15 insertions(+), 2 deletions(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/StaffEdits.class.php b/StaffEdits.class.php
index a6e9792..cd8de2f 100644
--- a/StaffEdits.class.php
+++ b/StaffEdits.class.php
@@ -85,4 +85,15 @@
 
                return true;
        }
-}
\ No newline at end of file
+
+       /**
+        * Registers, and marks as active, the staff edit change tag.
+        *
+        * @param array $tags
+        * @return bool
+        */
+       public static function onListDefinedAndActiveTags( array &$tags ) {
+               $tags[] = self::msgKey( 'staffedit' );
+               return true;
+       }
+}
diff --git a/StaffEdits.php b/StaffEdits.php
index 0b89605..e41c2f4 100644
--- a/StaffEdits.php
+++ b/StaffEdits.php
@@ -48,4 +48,6 @@
 
 $wgHooks['EditPage::showEditForm:initial'][] = 'StaffEdits::onEditPage';
 $wgHooks['ListDefinedTags'][] = 'StaffEdits::onListDefinedTags';
-$wgHooks['RecentChange_save'][] = 'StaffEdits::onRecentChange_save';
\ No newline at end of file
+$wgHooks['RecentChange_save'][] = 'StaffEdits::onRecentChange_save';
+$wgHooks['ListDefinedTags'][] = 'StaffEdits::onListDefinedAndActiveTags';
+$wgHooks['ChangeTagsListActive'][] = 'StaffEdits::onListDefinedAndActiveTags';

-- 
To view, visit https://gerrit.wikimedia.org/r/187349
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I11ecfd65b5ad320d56e86f502dc9e40192c7d212
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/StaffEdits
Gerrit-Branch: master
Gerrit-Owner: TTO <[email protected]>
Gerrit-Reviewer: Anomie <[email protected]>
Gerrit-Reviewer: Jack Phoenix <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to