MediaWiki  master
MediaWiki\Hook\ParserSectionCreateHook Interface Reference

This is a hook handler interface, see docs/Hooks.md. More...

Inheritance diagram for MediaWiki\Hook\ParserSectionCreateHook:

Public Member Functions

 onParserSectionCreate ( $parser, $section, &$sectionContent, $showEditLinks)
 This hook is called each time the parser creates a document section from wikitext. More...
 

Detailed Description

This is a hook handler interface, see docs/Hooks.md.

Use the hook name "ParserSectionCreate" to register handlers implementing this interface.

Deprecated:
since 1.35

Definition at line 14 of file ParserSectionCreateHook.php.

Member Function Documentation

◆ onParserSectionCreate()

MediaWiki\Hook\ParserSectionCreateHook::onParserSectionCreate (   $parser,
  $section,
$sectionContent,
  $showEditLinks 
)

This hook is called each time the parser creates a document section from wikitext.

Use this to apply per-section modifications to HTML (like wrapping the section in a DIV). Caveat: DIVs are valid wikitext, and a DIV can begin in one section and end in another. Make sure your code can handle that case gracefully. See the EditSectionClearerLink extension for an example.

Since
1.35
Parameters
Parser$parserCalling Parser instance
int$sectionSection number, zero-based, but section 0 is usually empty
string&$sectionContentReference to the content of the section, which can be modified by the hook
bool$showEditLinksWhether this section has an edit link
Returns
bool|void True or no return value to continue or false to abort

Implemented in MediaWiki\HookContainer\HookRunner.


The documentation for this interface was generated from the following file: