MediaWiki  master
MediaWiki\Content\Hook\ContentModelCanBeUsedOnHook Interface Reference

Stable to implement. 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. More...
 

Detailed Description

Stable to implement.

Definition at line 11 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: