MediaWiki REL1_39
MediaWiki\Content\Hook\ContentModelCanBeUsedOnHook Interface Reference

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

Inheritance diagram for MediaWiki\Content\Hook\ContentModelCanBeUsedOnHook:

Public Member Functions

 onContentModelCanBeUsedOn ( $contentModel, $title, &$ok)
 Use this hook to determine whether a content model can be used on a given page.
 

Detailed Description

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

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

Stability: stable
to implement

Definition at line 14 of file ContentModelCanBeUsedOnHook.php.

Member Function Documentation

◆ onContentModelCanBeUsedOn()

MediaWiki\Content\Hook\ContentModelCanBeUsedOnHook::onContentModelCanBeUsedOn ( $contentModel,
$title,
& $ok )

Use this hook to determine whether a content model can be used on a given page.

This is especially useful to prevent some content models from being used in a certain location.

Since
1.35
Parameters
string$contentModelContent model ID
Title$title
bool&$okWhether it is OK to use $contentModel on $title. Handler functions that modify $ok should generally return false to prevent the remaining hooks from further modifying $ok.
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: