WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 months ago

#10652 closed enhancement (wontfix)

Additional arguments required for page_template_dropdown

Reported by: husobj Owned by:
Milestone: Priority: normal
Severity: trivial Version: 2.8.4
Component: Themes Keywords: has-patch needs-testing gsoc close
Focuses: administration, template Cc:

Description

As a plugin/theme developer, it would be really useful to be able to call the page_template_dropdown function with a parameter string similar to wp_dropdown_pages.

For example, the current '$default' argument should accept a string of arguments where:

  • 'selected' is the selected template (replaces the current $default)
  • 'echo' can be set to 1 to return instead of output
  • 'name' will set a name/id for the menu

This would make it easier to create plugin/theme options where you could select which templates you want to use for different content.

At the moment it is possible to do this by replicating and adapting this function but I think it would make more sense to use the same multi-parameter argument as wp_dropdown_pages and wp_dropdown_categories and include it in core?

Attachments (1)

10652.diff (1006 bytes) - added by wojtek.szkutnik 5 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 @husobj6 years ago

Sorry, have just reviewed, and to clarify, only the 'echo' parameter is needed as the function only outputs the <option> tags, not the <select> tag which can already be added separately and customised.

comment:2 @scribu6 years ago

  • Keywords needs-patch added; reporter-feedback removed
  • Milestone changed from Unassigned to 2.9

comment:3 @westi6 years ago

  • Milestone changed from 2.9 to Future Release

Needs a Patch and is an enhancement.

Moving to Future for now.

comment:4 @wojtek.szkutnik5 years ago

  • Cc wojtek.szkutnik@… added
  • Keywords has-patch needs-testing gsoc added; needs-patch removed

@wojtek.szkutnik5 years ago

comment:5 follow-up: @jeremyfelt18 months ago

  • Component changed from Administration to Themes
  • Keywords close added

IMO, the ability to add your own markup after calling get_page_templates() is more desirable and already available. I'm not sure this is something we need to account for.

Suggesting wontfix.

comment:6 @jeremyfelt18 months ago

  • Focuses administration template added

comment:7 in reply to: ↑ 5 @obenland6 months ago

  • Milestone Future Release deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Replying to jeremyfelt:

IMO, the ability to add your own markup after calling get_page_templates() is more desirable and already available. I'm not sure this is something we need to account for.

I agree, there is very little gained by it.

Note: See TracTickets for help on using tickets.