Opened 3 years ago

Closed 3 years ago

#14863 closed enhancement (wontfix)

dynamic custom image header size

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

Description

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: http://nopaste.info/9fb388c8d9.html

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)

  • Owner set to a.hoereth
  • Status changed from new to accepted
  • Keywords custom_image_header HEADER_IMAGE_WIDTH HEADER_IMAGE_HEIGHT custom-header.php added
  • Keywords custom_image_header HEADER_IMAGE_WIDTH HEADER_IMAGE_HEIGHT custom-header.php removed

Can you post a subversion patch? http://core.trac.wordpress.org/#HowtoSubmitPatches

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

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?

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?

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

http://lists.automattic.com/pipermail/wp-hackers/2010-September/034939.html

Maybe someone could help?

  • Resolution set to invalid
  • Status changed from accepted to closed
  • Milestone Awaiting Review deleted
  • Resolution invalid deleted
  • Status changed from closed to reopened
  • Resolution set to wontfix
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.