&$url: the image url
&$alt: the image's alt text
&$img: the new image HTML (if returning false)
+&$attribs: the attributes to be applied.
'LinkerMakeExternalLink': At the end of Linker::makeExternalLink() just before the return
&$url: the link url
/** @todo document */
function makeExternalLink( $url, $text, $escape = true, $linktype = '', $attribs = array() ) {
$attribsText = $this->getExternalLinkAttributes( $url, $text, 'external ' . $linktype );
- if ( $attribs ) {
- $attribsText .= Xml::expandAttributes( $attribs );
- }
$url = htmlspecialchars( $url );
if( $escape ) {
$text = htmlspecialchars( $text );
}
$link = '';
- $success = wfRunHooks('LinkerMakeExternalLink', array( &$url, &$text, &$link ) );
+ $success = wfRunHooks('LinkerMakeExternalLink', array( &$url, &$text, &$link, &$attribs ) );
if(!$success) {
wfDebug("Hook LinkerMakeExternalLink changed the output of link with url {$url} and text {$text} to {$link}\n", true);
return $link;
}
+ if ( $attribs ) {
+ $attribsText .= Xml::expandAttributes( $attribs );
+ }
return '<a href="'.$url.'"'.$attribsText.'>'.$text.'</a>';
}