Merge "Hook to allow manipulation of image data"

This commit is contained in:
jenkins-bot 2012-12-23 18:01:30 +00:00 committed by Gerrit Code Review
commit 3158abd351
2 changed files with 8 additions and 0 deletions

View file

@ -2151,6 +2151,11 @@ $request: WebRequest
$title: Title of the currently found title obj
$output: OutputPage object
'ThumbnailBeforeProduceHTML': called before an image HTML is about to be rendered (by ThumbnailImage:toHtml method)
$thumbnail: the ThumbnailImage object
&$attribs: image attibute array
&$linkAttribs: image link attribute array
'TitleArrayFromResult': called when creating an TitleArray object from a
database result
&$titleArray: set this to an object to override the default object returned

View file

@ -347,6 +347,9 @@ class ThumbnailImage extends MediaTransformOutput {
if ( !empty( $this->responsiveUrls ) ) {
$attribs['srcset'] = Html::srcSet( $this->responsiveUrls );
}
wfRunHooks( 'ThumbnailBeforeProduceHTML', array( $this, &$attribs, &$linkAttribs ) );
return $this->linkWrap( $linkAttribs, Xml::element( 'img', $attribs ) );
}