MediaWiki REL1_35
MediaWiki\Content\Hook\ConvertContentHook Interface Reference

Stable to implement. More...

Inheritance diagram for MediaWiki\Content\Hook\ConvertContentHook:

Public Member Functions

 onConvertContent ( $content, $toModel, $lossy, &$result)
 This hook is called by AbstractContent::convert when a conversion to another content model is requested.
 

Detailed Description

Stable to implement.

Definition at line 11 of file ConvertContentHook.php.

Member Function Documentation

◆ onConvertContent()

MediaWiki\Content\Hook\ConvertContentHook::onConvertContent (   $content,
  $toModel,
  $lossy,
$result 
)

This hook is called by AbstractContent::convert when a conversion to another content model is requested.

Handler functions that modify $result should generally return false to disable further attempts at conversion.

Since
1.35
Parameters
Content$contentContent object to be converted
string$toModelID of the content model to convert to
bool$lossyWhether lossy conversion is allowed
Content | bool&$resultOutput parameter, in case the handler function wants to provide a converted Content object. Note that $result->getContentModel() must return $toModel.
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: