WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 3 years ago

#15523 closed enhancement (duplicate)

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

Reported by: 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 5 years ago.
Inclusion of multiple and size attributes on wp_dropdown_pages(). Some whitespace fixing.

Download all attachments as: .zip

Change History (10)

comment:1 @nacin5 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.

@GaryJ5 years ago

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

comment:2 @GaryJ5 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

comment:3 @ocean905 years ago

  • Milestone set to Awaiting Review

comment:4 follow-up: @mdawaffe5 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 );

comment:5 in reply to: ↑ 4 @GaryJ5 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.

comment:6 @ocean903 years ago

#20156 with another patch multiple values.

Version 0, edited 3 years ago by ocean90 (next)

comment:7 @scribu3 years ago

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

comment:8 @scribu3 years ago

  • Keywords close added; needs-patch removed

comment:9 @scribu3 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.