Manual:タグ

This page is a translated version of the page Manual:Tags and the translation is 81% complete.

変更タグまたは版タグは、版や記録項目に関連付けられた注釈です。 これらは、版に言及する際に、ページ履歴、差分表示、最近の更新など、さまざまな場所で表示されます。

利用できるタグの完全な一覧は Special:Tags に表示されます。 Users with the managechangetags user right – administrators by default – can use this special page to create and delete tags. (See Help:タグ .)

Extensions (for example AbuseFilter and VisualEditor ) mark edits made through their interface with tags.

タグ名

拡張機能でタグをハード コードする予定がある場合は、競合を避けるためにややユニークな名前を選ぶようにしてください。 例えば、ビジュアルエディターは visualeditor, visualeditor-needcheck, visualeditor-switched を使用します。 タグ名には ,/ の文字は使用できません。

If your extension allows users to enter their own tag names, you can use the ChangeTags::canCreateTag( $tag ) function to validate those names. (There is no need to pass the optional $user parameter for this purpose.) この関数は、無効なタグ名や他の拡張機能やウィキの利用者によって既に予約されているタグ名を拒否します。

あなたの拡張機能が使用するすべてのタグ (ハード コードされたものまたは利用者が提供するもの) を登録するために、ListDefinedTags フックを実装してください。 タグがアクティブに使用されている場合 (つまり、無効になっていない場合)、ChangeTagsListActive フックを介して列挙する必要もあります。

特定のタグの作成を利用者が行わないようにしたい場合は、ChangeTagCanCreate フックを実装できます。 For example, the OAuth extension uses this hook to reserve all tags beginning with OAuth CID:. (See source.)

拡張機能からのタグの使用

少なくとも 1 つの版で使用されるすべてのタグと、ListDefinedTags フックに列挙されているタグは、Special:Tags で表示されます。

各タグにはコード名があり、それがそのユニークな識別子として機能します。 このコード名は Special:Tags に表示されます。 2 つのメッセージは各タグに関連付けられます:

  • MediaWiki:tag-$name can be used to set the "display name" or "friendly name" of the tag. If set, this message will be used on history pages etc. instead of the tag's code name.
  • MediaWiki:tag-$name-description provides a description to be displayed on Special:Tags.

To add a tag to a revision, recent changes entry, or log entry, use ChangeTags::addTag(). The RecentChange_save hook can be useful for this purpose.

Special:Tags を拡張する

By default, tags defined by extensions cannot be manipulated from Special:Tags at all. All tag management tasks are left up to the extension.

If you wish, you can allow users to delete a tag defined by your extension from the regular Special:Tags interface. To do this, you must implement the ChangeTagCanDelete hook to mark the tag as deletable, then implement the ChangeTagAfterDelete hook to perform extension-specific cleanup actions after MediaWiki has removed the tag from all revisions and log entries to which it is applied.

コアの変更タグの一覧

MediaWiki バージョン:
1.40
  • mw-contentmodelchange: changing the content model
  • mw-new-redirect, mw-removed-redirect, mw-changed-redirect-target: turning a page into a redirect / a redirect into a normal page / changing where a redirect goes
  • mw-blank: blanking the page
  • mw-replace: changing more than 90% of the page text
  • mw-rollback, mw-undo, mw-manual-revert: various kinds of reverts
  • mw-reverted: edit that got reverted
  • mw-server-side-upload: file uploaded using maintenance script

関連項目

提案: