Make WordPress Core

Opened 9 months ago

Closed 8 months ago

Last modified 8 months ago

#59768 closed defect (bug) (fixed)

Replace `tabindex` example in submit button function docs

Reported by: sabernhardt's profile sabernhardt Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 6.5 Priority: normal
Severity: normal Version:
Component: Administration Keywords: good-first-bug has-patch
Focuses: accessibility, docs Cc:

Description

[21311] removed positive tabindex values from the submit_button() and get_submit_button() functions, but tabindex="1" is still the example for $other_attributes in their documentation.

Attachments (1)

5605.diff (2.6 KB) - added by fushar 8 months ago.

Download all attachments as: .zip

Change History (9)

#1 @sabernhardt
9 months ago

Core uses id, disabled, aria-describedby and/or data-wp-lists for some of its submit buttons. Or there might be a better option.

#2 @SergeyBiryukov
9 months ago

  • Keywords good-first-bug added
  • Milestone changed from Awaiting Review to 6.5

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


9 months ago
#3

  • Keywords has-patch added; needs-patch removed

Updates the docs on submit_button and get_submit_button function to match the general implementation used in wordpress. In ticket https://core.trac.wordpress.org/changeset/21311 the usage of tabindex="1" was removed and it was suggested that another example be used. This PR switches the docs to use the id attribute as an example instead.

Trac ticket: [](https://core.trac.wordpress.org/ticket/59768)

#4 @benjaminknox
9 months ago

In https://github.com/WordPress/wordpress-develop/pull/5605 I chose to use the id attribute as an example, I think it is a pretty good example for the button considering it would be set by developers pretty often.

Last edited 9 months ago by benjaminknox (previous) (diff)

@fushar
8 months ago

#5 @SergeyBiryukov
8 months ago

  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

#6 @sabernhardt
8 months ago

The ID should be a good choice. I have a small concern that a developer might use exactly the same ID in a plugin, but Core's search-submit example is probably better than imagining a hypothetical example.

Last edited 8 months ago by sabernhardt (previous) (diff)

#7 @SergeyBiryukov
8 months ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 57114:

Docs: Replace tabindex example in submit button functions documentation.

Most of the tabindex attributes across the admin were removed in [21311].

This commit updates the example for the $other_attributes parameter to use the id attribute instead.

Includes synchronizing documentation between submit_button() and get_submit_button().

Follow-up to [15810], [16061], [21311], [27136], [31599].

Props benjaminknox, sabernhardt, fushar, SergeyBiryukov.
Fixes #59768.

@SergeyBiryukov commented on PR #5605:


8 months ago
#8

Thanks for the PR! Merged in r57114.

Note: See TracTickets for help on using tickets.