Manual:Hooks/FormatAutocomments

FormatAutocomments
Available from version 1.20.0
When an autocomment is formatted by the Linker.
Define function:
public static function onFormatAutocomments( &$comment, $pre, $auto, $post, $title, $local ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"FormatAutocomments": "MyExtensionHooks::onFormatAutocomments"
	}
}
Called from:File(s): Linker.php
Interface:FormatAutocommentsHook.php

For more information about attaching hooks, see $1.
For examples of extensions using this hook, see Category:FormatAutocomments extensions.

DetailsEdit

  • &$comment: Reference to the accumulated comment. Initially null, when set the default code will be skipped.
  • $pre: Initial part of the parsed comment before the call to the hook.
  • $auto: The extracted part of the parsed comment before the call to the hook.
  • $post: The final part of the parsed comment before the call to the hook.
  • $title: An optional title object used to links to sections. Can be null.
  • $local: Boolean indicating whether section links should refer to local page.