Make WordPress Core

Opened 14 years ago

Closed 11 years ago

Last modified 11 years ago

#14890 closed enhancement (duplicate)

dynamic custom header image sizes patch

Reported by: ahoereth's profile a.hoereth Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Themes Keywords:
Focuses: Cc:

Description

This patch adds the capability for theme developers to use maximum, fixed or automatic header image sizes.

HEADER_IMAGE_WIDTH and HEADER_IMAGE_HEIGHT can be set to 3 different states:
fixed - "940" - like the old feature. all images get resized to a fixed size
max - "max:940" - smaller images are not resized
auto - "auto" - no images are changed

At the moment the if clause handling if the image has to be resized and how is very complex. I can simplify it very easily, but didnt due to the possibility that we could at a "manual/automatic cropping" button or just change some conditions to manual cropping if it "feels" better. Needs some testing first..

The patch adds 4 new functions which - in future - will be used to return or echo the header_image's width and height:
get_header_image_width() - header_image_width()
get_header_image_height() - header_image_height()

If the whole uploading process would be filterable I would add this as a plugin, but I think it would be nice to have this feature in the core as well.

It is not ready for release yet though. E.g. need to add an explanation of the 3 states to be displayed to the user.

Attachments (1)

dynamic custom header image sizes.patch (13.5 KB) - added by a.hoereth 14 years ago.
svn patch

Download all attachments as: .zip

Change History (5)

#1 @scribu
14 years ago

  • Keywords has-patch added; removed

#2 @nacin
14 years ago

  • Keywords needs-patch 2nd-opinion added; has-patch needs-testing removed
  • Milestone changed from Awaiting Review to Future Release

This just tries to do too much.

#3 @sabreuse
11 years ago

  • Keywords needs-patch 2nd-opinion removed
  • Milestone Future Release deleted
  • Resolution set to fixed
  • Status changed from new to closed

header image widths/heights were overhauled in #17242 and related tickets

#4 @SergeyBiryukov
11 years ago

  • Resolution changed from fixed to duplicate
Note: See TracTickets for help on using tickets.