Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#14863 closed enhancement (wontfix)

dynamic custom image header size

Reported by: a.hoereth Owned by: a.hoereth
Milestone: Priority: normal
Severity: normal Version: 3.0.1
Component: Post Thumbnails Keywords:
Focuses: Cc:


Hey there,
directly after starting using the new custom image headers I wanted to just define a max size or even do not change them so the end-user can choose his own size. So my theme probably would just center the image in the branding section - the size would not matter.

So I now added the HEADER_IMAGE_SIZE_TYPE constant and a if clause in the uploading process in wp-admin/custom-header.php

Here is what Ive got:

There need more changes to be done. Small things like the if clause for the text at line 464 in wp-admin/custom-header.php ("Images of exact...")..

First Feedback? Hope no one else did start something like that already - did not find anything about it yet..

Change History (9)

#1 @a.hoereth
11 years ago

  • Owner set to a.hoereth
  • Status changed from new to accepted

#2 @a.hoereth
11 years ago

  • Keywords custom_image_header HEADER_IMAGE_WIDTH HEADER_IMAGE_HEIGHT custom-header.php added

#3 @nacin
11 years ago

  • Keywords custom_image_header HEADER_IMAGE_WIDTH HEADER_IMAGE_HEIGHT custom-header.php removed

Can you post a subversion patch?

We wouldn't add a constant for this, probably a filter or incorporate it as an aspect of theme support.

#4 @a.hoereth
11 years ago

U mean just submit the above code through subversion?
I though i better would post it here cause it is not finished yet - other things need to be changed.

How would you do it using filters?

First I didnt want to add a new constant but work with the 2 HEADER_IMAGE_WIDTH/HEIGHT using three states:

  • fixed size, '940'
  • max size, 'max:940'
  • original size, 'auto'

This way theme developers would be able to even give a max height but a fixed width etc - more flexibility and no new constant. Does this sound better?

#5 @a.hoereth
11 years ago

Ok.. Problem about using the same constants is that you can not change their values.
Some Themes already use these Constants and would break if their value consists something like "max:"..

If these constants are changed we need new functions like header_image_width() which echos the HEADER_IMAGE_WIDTH without "max:" or if HEADER_IMAGE_WIDTH == "auto" echos the actual image width - not the value of the constant.

Is no one else interested in a feature like this?

#6 @a.hoereth
11 years ago

Me again. I send a mail to the wp-hackers list but no one reacted..

Maybe someone could help?

#7 @a.hoereth
11 years ago

  • Resolution set to invalid
  • Status changed from accepted to closed

#8 @scribu
11 years ago

  • Milestone Awaiting Review deleted
  • Resolution invalid deleted
  • Status changed from closed to reopened

#9 @scribu
11 years ago

  • Resolution set to wontfix
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.