WordPress.org

Make WordPress Core

Opened 9 years ago

Closed 4 years ago

#18959 closed enhancement (wontfix)

Allow choosing multiple header images

Reported by: wikicms Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.3
Component: Customize Keywords: ux-feedback dev-feedback 2nd-opinion needs-patch
Focuses: Cc:

Description

Please, see small screenshot :)

http://trueimages.ru/img/0f/5b/b7cf5f11a2786fc804521503268.png

Description: This is the theme TwentyEleven. I want choose multiple header images, (for example 4,5,6), but i cannot. Only random or only one. Thanks.

Attachments (2)

multiple-header-images.diff (7.7 KB) - added by jphase 6 years ago.
Allow multiple header images
multiple-header-images.2.diff (7.6 KB) - added by jphase 6 years ago.
Updated diff to fix minor syntax discrepancies

Download all attachments as: .zip

Change History (18)

#1 @SergeyBiryukov
8 years ago

  • Keywords ux-feedback added

#2 @ericlewis
8 years ago

I'd say this falls under either child-theme or plugin development.

#3 @nacin
7 years ago

  • Component changed from Themes to Appearance

This ticket was mentioned in IRC in #wordpress-dev by jphase. View the logs.


6 years ago

@jphase
6 years ago

Allow multiple header images

#5 @jphase
6 years ago

Hey everyone, this is my first diff so if I did anything wrong (syntactically or otherwise) then please give me feedback. I want to learn the right way to contribute :)

I updated the UI to have checkboxes next to each image and a bit of jQuery to toggle between the "Random" radio and the selected checkboxes. The "Random" radio still just pulls random images from the default images and I modified get_random_header_image() to allow an optional paths array to be passed which will allow a random index to be returned.

Perhaps we could eventually allow an interface to save a preferred order of the selected images later?

@jphase
6 years ago

Updated diff to fix minor syntax discrepancies

#6 @jphase
6 years ago

  • Keywords has-patch added; needs-patch removed

#7 @jphase
6 years ago

  • Keywords dev-feedback needs-testing added

This ticket was mentioned in IRC in #wordpress-dev by jphase. View the logs.


6 years ago

#9 follow-up: @simonwheatley
6 years ago

Hi Jphase,

I don't have time to test your patch right now (bedtime!), sorry, but I can point you towards the existing header tests. If you have the new style WordPress development repo, they are in tests/phpunit/tests/image/header.php, or here's a link to them in SVN: http://develop.svn.wordpress.org/trunk/tests/phpunit/tests/image/header.php

Here's some info on automated tests, in case it's useful: http://make.wordpress.org/core/handbook/automated-testing/

(Note the stuff on @ticket, that tripped me up when I couldn't work out why my tests weren't working.)

Hope this helps.

#10 in reply to: ↑ 9 @jphase
6 years ago

Replying to simonwheatley:

Hi Jphase,

I don't have time to test your patch right now (bedtime!), sorry, but I can point you towards the existing header tests. If you have the new style WordPress development repo, they are in tests/phpunit/tests/image/header.php, or here's a link to them in SVN: http://develop.svn.wordpress.org/trunk/tests/phpunit/tests/image/header.php

Here's some info on automated tests, in case it's useful: http://make.wordpress.org/core/handbook/automated-testing/

(Note the stuff on @ticket, that tripped me up when I couldn't work out why my tests weren't working.)

Hope this helps.

Hey Simon,

Thanks for the info; it was exactly what I needed. I ran the phpunit test from the "header" group and it appears like things are okay. Here's a screenshot from my terminal. Let me know if I did this right or if I missed anything.

http://snag.gy/zriQr.jpg

#11 @simonwheatley
6 years ago

I'd also try running the tests with the ticket number in the group parameter too, this will ensure any tests relating to this ticket are not skipped:

phpunit --group header,18959

#12 @jphase
6 years ago

Gotcha, thx for all the info Simon. I'm sure nothing is different on this test since there aren't any actual tests attached to this ticket but just to be thorough, here's the latest output:

http://snag.gy/eDf5R.jpg

#13 @celloexpressions
6 years ago

  • Keywords 2nd-opinion added

The headers admin page is now only accessible to no-js users and a couple of other edge cases where the Customizer isn't supported. Headers in the Customizer could potentially benefit from this for default headers, although this functionality is present for user-uploaded ones of course.

Is anyone still interested in making improvements here, given that?

#14 @swissspidy
5 years ago

  • Keywords needs-patch added; has-patch needs-testing removed

This ticket was mentioned in Slack in #core-customize by westonruter. View the logs.


4 years ago

#16 @melchoyce
4 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

You can kind of already do this by removing the images you don't want to appear randomized. This seems like it would need a special UI for a very small use case, so I’m going to close.

Note: See TracTickets for help on using tickets.