Make WordPress Core

Opened 14 years ago

Closed 13 years ago

#15523 closed enhancement (duplicate)

wp_dropdown_pages() should be able to generate a multi-select

Reported by: christian_gnoth's profile christian_gnoth Owned by:
Milestone: Priority: normal
Severity: minor Version: 3.0.1
Component: General Keywords: close
Focuses: Cc:

Description

it would be useful if this functions offers parameters for this two options:

  • multiple="multiple"
  • size="xyz"

so that also drop down boxes with multiple select option and a bigger size can be displayed

Attachments (1)

15523.diff (2.3 KB) - added by GaryJ 14 years ago.
Inclusion of multiple and size attributes on wp_dropdown_pages(). Some whitespace fixing.

Download all attachments as: .zip

Change History (10)

#1 @nacin
14 years ago

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

Core doesn't need this, but you can re-open with a patch.

@GaryJ
14 years ago

Inclusion of multiple and size attributes on wp_dropdown_pages(). Some whitespace fixing.

#2 @GaryJ
14 years ago

  • Cc GaryJ added
  • Keywords has-patch needs-testing added; wp_dropdown_pages select tag removed
  • Resolution maybelater deleted
  • Severity changed from normal to minor
  • Status changed from closed to reopened

#3 @ocean90
14 years ago

  • Milestone set to Awaiting Review

#4 follow-up: @mdawaffe
14 years ago

  • Keywords needs-patch added; has-patch needs-testing removed
  • Milestone changed from Awaiting Review to Future Release
  • Summary changed from wp_dropdown_pages() to wp_dropdown_pages() should be able to generate a multi-select

Looks reasonable. No need to escape quotes: \". Just nest with the opposite quote style.

Should selected accept an array/csv of IDs?

PS: Can we add the args to the filter? Seems pretty useless without it.

apply_filters( 'wp_dropdown_pages', $output, $r );

#5 in reply to: ↑ 4 @GaryJ
14 years ago

I would have preferred not to escape quotes, but it does elsewhere in the function, so I was keeping with consistency.

I agree with selected now needing to accept multiple values, but I'm not sure how to amend that so it feeds nicely into the walker - some amendment of Walker_PageDropdown::start_el() checking with is_array() may well be needed.

#6 @ocean90
13 years ago

#20156 with another patch for multiple values.

Last edited 13 years ago by ocean90 (previous) (diff)

#7 @scribu
13 years ago

<select multiple> has a horrible UX. We should not encourage it's use.

#8 @scribu
13 years ago

  • Keywords close added; needs-patch removed

#9 @scribu
13 years ago

  • Milestone Future Release deleted
  • Resolution set to duplicate
  • Status changed from reopened to closed

Going to close as duplicate of #20156, since it has more patches.

Note: See TracTickets for help on using tickets.