Make WordPress Core

Opened 14 years ago

Last modified 45 hours ago

#20810 new enhancement

Add disable arg or attributes arg to wp_dropdown_categories() & wp_dropdown_pages()

Reported by: wpsmith's profile wpsmith Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.1
Component: Posts, Post Types Keywords: has-patch
Focuses: template Cc:

Description

It would be beneficial to be able to add disabled="disabled" attribute to the select tag or add multiple attributes to the select tag.

Related: #20156, #20167

Attachments (4)

wp_dropdown_categories_disabled_opt.patch (1.1 KB) - added by wpsmith 14 years ago.
Disabled arg for wp_dropdown_categories()
wp_dropdown_categories_attr_opt.patch (1.2 KB) - added by wpsmith 14 years ago.
Extra attributes for wp_dropdown_categories()
wp_dropdown_pages_disabled_opt.patch (1.0 KB) - added by wpsmith 14 years ago.
Disabled arg for wp_dropdown_pages()
wp_dropdown_pages_attr_opt.patch (1.1 KB) - added by wpsmith 14 years ago.
Extra attributes for wp_dropdown_pages()

Download all attachments as: .zip

Change History (11)

@wpsmith
14 years ago

Disabled arg for wp_dropdown_categories()

@wpsmith
14 years ago

Extra attributes for wp_dropdown_categories()

@wpsmith
14 years ago

Disabled arg for wp_dropdown_pages()

@wpsmith
14 years ago

Extra attributes for wp_dropdown_pages()

#1 @prionkor
14 years ago

+1 we need it on all dropdown functions.

Version 0, edited 14 years ago by prionkor (next)

#2 @prionkor
14 years ago

  • Cc sisir@… added

#3 @nacin
12 years ago

  • Component changed from Template to Posts, Post Types
  • Focuses template added

#4 @lumpysimon
11 years ago

+1 for this, I'm having to use jQuery at the moment to achieve this.

#5 @johnbillion
11 years ago

  • Keywords has-patch needs-refresh added
  • Milestone changed from Awaiting Review to Future Release
  • Version set to 2.1

Patch needs a refresh.

#6 @garrett-eclipse
10 years ago

+1
Currently utilizing jQuery or rebuilding the $output through the wp_dropdown_cats filter.

This ticket was mentioned in PR #12145 on WordPress/wordpress-develop by @sainathpoojary.


45 hours ago
#7

  • Keywords needs-refresh removed

This PR adds a disabled boolean argument to both wp_dropdown_categories() and wp_dropdown_pages(). When set to true, the generated <select> dropdowns are rendered with the HTML5 disabled attribute (<select disabled>).

https://github.com/user-attachments/assets/a8cf79a3-a027-44c1-ae02-00d3b3f48811

Trac ticket: #20810

Note: See TracTickets for help on using tickets.