Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#14402 closed enhancement (fixed)

Twenty Ten: add height to twentyten_attachment_size filter

Reported by: iandstewart Owned by:
Milestone: 3.1 Priority: normal
Severity: normal Version:
Component: Themes Keywords: needs-testing, has-patch
Focuses: Cc:


In hindsight, the (essentially limitless) height for gallery images on attachment pages looks to be too much. 900px wide portrait images wind up looking way too large in galleries.

The attached diff uses the filterable width limit of 900px for the height limit as well. It puts the bulk of really large portrait-oriented images on screen while still looking appropriately sized when mixed with full-width landscape-oriented images in a gallery.

Attachments (3)

gallery-image-height.diff (766 bytes) - added by iandstewart 11 years ago.
14402.refreshed.diff (1003 bytes) - added by lancewillett 11 years ago.
14402.refreshed-2.diff (1.9 KB) - added by lancewillett 11 years ago.

Download all attachments as: .zip

Change History (11)

#1 @iandstewart
11 years ago

  • Component changed from General to Themes

#2 @nacin
11 years ago

Could we do this in a way that causes them to be filterable independently? What about passing them to a new filter as an array?

If that seems unnecessary, then that's fine too.

#3 @lancewillett
11 years ago

  • Cc lance@… added
  • Keywords needs-testing has-patch added
  • Summary changed from Twenty Ten: A limit to image gallery heights to Twenty Ten: add height to twentyten_attachment_size filter
  • Type changed from defect (bug) to enhancement

Adding refreshed patch that filters the height and width separately (as an array).

#4 follow-up: @nacin
11 years ago

This breaks any existing uses of twentyten_attachment_size.

#5 in reply to: ↑ 4 @lancewillett
11 years ago

Replying to nacin:

This breaks any existing uses of twentyten_attachment_size.

Back compat be darned! Mwahahaha. Just kidding. I'll work on a better patch that introduces a new filter and leaves the old one as it was.

#6 @lancewillett
11 years ago

14402.refreshed-2.diff moves the code to functions.php and applies the old filter for width for back compat.

#7 @nacin
11 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [17305]) Add twentyten_attachment_height filter. props lancewillett, fixes #14402.

#8 @nacin
11 years ago

  • Milestone changed from Awaiting Review to 3.1
Note: See TracTickets for help on using tickets.