Make WordPress Core

Opened 5 years ago

Closed 3 months ago

#7993 closed enhancement (wontfix)

Missing tabindex argument for wp_dropdown generated inputs

Reported by: Malaiac Owned by:
Milestone: Priority: normal
Severity: minor Version: 2.7
Component: Template Keywords: gsoc has-patch
Focuses: Cc:


http://codex.wordpress.org/Template_Tags/wp_dropdown_categories allows to create a select for categories.

There is no tabindex option in common arguments, which is a loss for usability.

There could be other functions affected.

Attachments (2)

7993.diff (2.1 KB) - added by wojtek.szkutnik 4 years ago.
7993.2.diff (2.9 KB) - added by wojtek.szkutnik 4 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 Malaiac5 years ago

  • Type changed from defect to enhancement

comment:2 FFEMTcJ5 years ago

  • Milestone changed from 2.8 to Future Release

comment:3 wojtek.szkutnik4 years ago

  • Cc wojtek.szkutnik@… added
  • Keywords gsoc has-patch added

wp_dropdown)user affected as well

wojtek.szkutnik4 years ago

comment:4 nacin4 years ago

"which is a loss for usability" -- tabindex is generally decried as poor usability that should be used sparingly. Not to suggest that there aren't valid use cases for having the argument in wp_dropdown_*, but I'm almost -1 just because the attribute is so misused.

comment:5 wojtek.szkutnik4 years ago

Shouldn't all wp_dropdown_* functions be consistent? The current version of wp_dropdown_categories already has a tab_index argument, while my patch fixes wp_dropdown_users and wp_dropdown_pages. We should either allow tab_index everywhere or remove it from wp_dropdown_categories.

comment:6 nacin4 years ago

I don't have a problem with adding it, only I wanted to clarify that it is not a usability issue as originally stated.

Re: the patch, it doesn't look like it is properly sanitized.. The cast would only affect the comparison. Ideally it should default to false. If !== false, then absint() and use it. (0 is allowed as a tabindex value.)

wojtek.szkutnik4 years ago

comment:7 wojtek.szkutnik4 years ago

Good point - fixed it in all three functions.

comment:8 nacin4 years ago

  • Keywords usability removed

Cool. One more thing, instead of escaping quotes: As a general rule, Use single quotes for PHP strings and double quotes for HTML attributes by default, and reverse them as appropriate to use PHP variables and such.

comment:9 nacin3 months ago

  • Milestone Future Release deleted
  • Resolution set to wontfix
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.