WordPress.org

Make WordPress Core

Opened 6 weeks ago

Last modified 12 days ago

#54302 new defect (bug)

Add labels to read-only form fields

Reported by: sabernhardt Owned by:
Milestone: 6.0 Priority: normal
Severity: normal Version:
Component: General Keywords: has-patch needs-copy-review needs-refresh
Focuses: accessibility, administration, coding-standards Cc:

Description

#53142 added label tags on the Permalinks settings screen, but there are still some more read-only form fields without a label.

  • The network setup screen has four textareas for code users need to paste into their wp-config file and the server configuration file (web.config or .htaccess).
  • When failing to create a wp-config.php file automatically, setup-config.php displays the code to include in the wp-config manually.
  • The admin toolbar can have a feature that shows a shortlink field when viewing a post. (This was only activated in core in 2011, from WP 3.1 to 3.3, and deactivated in r19519. However, the code is still available for plugins.)

Attachments (1)

54302.patch​ (5.0 KB) - added by sabernhardt 6 weeks ago.

Download all attachments as: .zip

Change History (9)

#1 @sabernhardt
6 weeks ago

  • Keywords has-patch added

Most of these can have label tags, but I had console errors when adding a non-visual label for the toolbar shortlink input. So I used an ARIA label instead for that one.

To view the toolbar shortlink, you need this in a plugin (or in class-wp-admin-bar.php):

add_action( 'admin_bar_menu', 'wp_admin_bar_shortlink_menu', 90 );

#2 @audrasjb
6 weeks ago

For the first textarea, I may be wrong but it looks like you're using this as a label:

'<code>/* ' . __( 'That&#8217;s all, stop editing! Happy publishing.' ) . ' */</code>'

I'm not convinced that it's the best option for this textarea as it's not a description of the goal of this field πŸ€”

#3 @sabernhardt
5 weeks ago

That's part of the proposed label text for the first textarea. I simply wrapped the full instruction for each of these in network setup:

Add the following to your wp-config.php file in [location] above the line reading /* That’s all, stop editing! Happy publishing. */:

These unique authentication keys are also missing from your wp-config.php file. To make your installation more secure, you should also add:

Add the following to your web.config file in [location], replacing other WordPress rules:

Add the following to your .htaccess file in [location], replacing other WordPress rules:

And the setup-config label is similar:

You can create the wp-config.php file manually and paste the following text into it.

Of course, there might be a better way :)

Last edited 5 weeks ago by sabernhardt (previous) (diff)

This ticket was mentioned in ​Slack in #accessibility by ryokuhi. ​View the logs.


5 weeks ago

#5 @ryokuhi
5 weeks ago

  • Keywords needs-copy-review added
  • Milestone changed from Awaiting Review to 5.9

We reviewed the ticket today during the weekly Accessibility Team's bug-scrub.
The ticket doesn't seem to require a lot of work, so it can be solved in time for the next major release.
To improve the wording of the labels, this ticket will probably benefit from a little copy review.

This ticket was mentioned in ​Slack in #accessibility by ryokuhi. ​View the logs.


2 weeks ago

#7 @joedolson
2 weeks ago

The copy for the labels needs to state the content of the fields; this patch uses text that would serve better as extra context via aria-describedby.

I think the labels should be simple: "Network Configuration Rules for wp-config.php", "Network Configuration Authentication Keys", and "Network Configuration rules for [htaccess/nginx config]"

These fields are almost exclusively for pretty high-level users, so they don't need to be elaborate.

The shortlink label text is fine as is.

#8 @sabernhardt
12 days ago

  • Keywords needs-refresh added
  • Milestone changed from 5.9 to 6.0
Note: See TracTickets for help on using tickets.