|
MediaWiki master
|
This is a hook handler interface, see docs/Hooks.md. More...
Inherited by MediaWiki\HookContainer\HookRunner.
Public Member Functions | |
| onLinkerMakeExternalLinkWithContext (?string &$url, string &$text, array &$attribs, string $linkType, LinkTarget $contextTitle) | |
| This hook is called at the end of Linker::makeExternalLink() just before the return. | |
This is a hook handler interface, see docs/Hooks.md.
Use the hook name "LinkerMakeExternalLinkWithContext" to register handlers implementing this interface.
Definition at line 15 of file LinkerMakeExternalLinkWithContextHook.php.
| MediaWiki\Linker\Hook\LinkerMakeExternalLinkWithContextHook::onLinkerMakeExternalLinkWithContext | ( | ?string & | $url, |
| string & | $text, | ||
| array & | $attribs, | ||
| string | $linkType, | ||
| LinkTarget | $contextTitle ) |
This hook is called at the end of Linker::makeExternalLink() just before the return.
It is a more modern version of LinkerMakeExternalLink, which provides a context title and reflects modern practice in not allowing direct mutation of the link HTML.
Parsoid allows rewriting or blocking (setting to null) the $url, and adding class, title, and rel attributes. Setting $url to null will block the link: no href attribute will be present on the tag.
| ?string | &$url | Link URL |
| string | &$text | Link text |
| string[] | &$attribs | Attributes to be applied |
| string | $linkType | External link type |
| LinkTarget | $contextTitle |