Make WordPress Core

Opened 8 years ago

Closed 7 years ago

#6064 closed defect (bug) (fixed)

Gallery should not link to non-images as if they were images.

Reported by: Nightgunner5 Owned by:
Milestone: 2.8 Priority: normal
Severity: normal Version: 2.5
Component: Gallery Keywords: has-patch needs-testing
Focuses: Cc:


The gallery currently links to all files that it includes with the <img src="" /> tag. It should link not to the file, but to the icon that matches the file extension for non-image files.

Attachments (2)

attachment_icon_gallery_fix.diff (598 bytes) - added by Nightgunner5 8 years ago.
attachment_icon_gallery_fix.2.diff (926 bytes) - added by Nightgunner5 8 years ago.

Download all attachments as: .zip

Change History (9)

#1 @Nightgunner5
8 years ago

Never mind, disregard the attachment.

#2 @Nightgunner5
8 years ago

Ok, the attachment should work now.

#3 @Nightgunner5
8 years ago

The gallery should also present some way for a theme's css to show different styles for images and non-images.

#4 @Nightgunner5
8 years ago

The [gallery] shortcode currently prints out a div inside a paragraph, along with a style tag.

The style tag should only be used inside the header, the div tag should not be used inside a p tag.

How this can be fixed

  • div inside of p
    • If a [gallery] tag is immediately next to the beginning or end of a paragraph, move the p tag to the other side of the gallery.
    • If the [gallery] tag is the only thing in a paragraph, completely remove the p tag.
  • style outside of head
    • Have theme authors add the styles needed directly to their templates' stylesheets.
    • Somehow move the style tag into the head tag. I don't think this is possible.

#5 @djr
8 years ago

  • Keywords has-patch needs-testing added

#6 @DD32
7 years ago

  • Component changed from General to Gallery
  • Owner anonymous deleted

The Gallery shouldn't show non-image mimetype files IIRC.

I think 2.7 also returns the icon for non-image files on thumbnail queries..

So can someone verify if this is still valid? (as of 2.7 stable)

#7 @Denis-de-Bernardy
7 years ago

  • Milestone changed from 2.9 to 2.8
  • Resolution set to fixed
  • Status changed from new to closed

seems to be working fine in trunk

Note: See TracTickets for help on using tickets.