Skip to content

Commit

Permalink
feat: add title to file link
Browse files Browse the repository at this point in the history
  • Loading branch information
alistair3149 committed Jun 2, 2024
1 parent 071d790 commit 2d445d3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions includes/ThumbnailImage.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,11 @@ public function toHtml( $options = [] ) {
$query
);
} elseif ( !empty( $options['file-link'] ) ) {
$linkAttribs = [ 'href' => $this->file->getUrl() ];
$linkAttribs = [
'href' => $this->file->getUrl(),
// Get the title of the file page
'title' => $this->file->getTitle()->getPrefixedText()
];
} else {
$linkAttribs = false;
if ( !empty( $options['title'] ) ) {
Expand Down Expand Up @@ -262,7 +266,8 @@ public function toHtml( $options = [] ) {
[
'href' => $this->file->getUrl(),
'class' => 'mw-file-source',
'title' => $this->file->getTitle()->getFullText()
// FIXME: Need i18n
'title' => 'View source image'
],
'<!-- Image link for Crawlers -->'
);
Expand Down

0 comments on commit 2d445d3

Please sign in to comment.