WordPress.org

Make WordPress Core

Opened 3 years ago

Last modified 2 weeks ago

#20810 new enhancement

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

Reported by: wpsmith Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 2.1
Component: Posts, Post Types Keywords: has-patch needs-refresh
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 3 years ago.
Disabled arg for wp_dropdown_categories()
wp_dropdown_categories_attr_opt.patch (1.2 KB) - added by wpsmith 3 years ago.
Extra attributes for wp_dropdown_categories()
wp_dropdown_pages_disabled_opt.patch (1.0 KB) - added by wpsmith 3 years ago.
Disabled arg for wp_dropdown_pages()
wp_dropdown_pages_attr_opt.patch (1.1 KB) - added by wpsmith 3 years ago.
Extra attributes for wp_dropdown_pages()

Download all attachments as: .zip

Change History (9)

@wpsmith3 years ago

Disabled arg for wp_dropdown_categories()

@wpsmith3 years ago

Extra attributes for wp_dropdown_categories()

@wpsmith3 years ago

Disabled arg for wp_dropdown_pages()

@wpsmith3 years ago

Extra attributes for wp_dropdown_pages()

comment:1 @prionkor3 years ago

+1 we need it on all dropdown functions.

An array of attribute could be passed. Like:

$args = array(

'attrs' = array(

'multiple' => 'multiple',
'disable' => 'disabled'

)

)

It will allow users to add extra attribute like classes or any other html 5 attributes on the dropdown.

Last edited 3 years ago by prionkor (previous) (diff)

comment:2 @prionkor3 years ago

  • Cc sisir@… added

comment:3 @nacin18 months ago

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

comment:4 @lumpysimon2 weeks ago

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

comment:5 @johnbillion2 weeks ago

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

Patch needs a refresh.

Note: See TracTickets for help on using tickets.