Make WordPress Core

Opened 4 years ago

Closed 22 months ago

#50572 closed defect (bug) (fixed)

Remove confusing upper case for option names on Edit Site: Settings screen

Reported by: sergeybiryukov's profile SergeyBiryukov Owned by: johnbillion's profile johnbillion
Milestone: 6.2 Priority: normal
Severity: normal Version:
Component: Networks and Sites Keywords: has-patch has-testing-info has-screenshots commit
Focuses: ui, administration, multisite Cc:

Description

  1. Go to Network Admin → All Sites.
  2. Select a site, click "Edit".
  3. Go to the Settings tab.

You'll see the list of option names displayed in a "readable" way:

  • Users Can Register
  • Admin Email
  • Start Of Week

This is done via ucwords( str_replace( '_', ' ', $option->option_name ) ).

There are two problems with this:

  • On non-English sites, it looks like some parts of the UI are not translated.
  • It doesn't make sense for options like "Bp-xprofile-base-group-name".

It would be better to just display the original option names instead:

  • users_can_register
  • admin_email
  • start_of_week

This would be consistent with the /wp-admin/options.php screen on single site.

Attachments (2)

50572.diff (1.6 KB) - added by sabernhardt 2 years ago.
removes uppercase, adds code class and language, escapes HTML consistently
50572.1.diff (1.6 KB) - added by sabernhardt 2 years ago.
removes uppercase, adds code class, escapes HTML consistently

Download all attachments as: .zip

Change History (9)

@sabernhardt
2 years ago

removes uppercase, adds code class and language, escapes HTML consistently

#1 @sabernhardt
2 years ago

  • Keywords has-patch added

The Siteurl capitalization does not make much sense either.

These labels would need the code class, and I think they might benefit from a language attribute.

#2 follow-up: @SergeyBiryukov
2 years ago

  • Milestone changed from Awaiting Review to 6.2
  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

Thanks for the patch!

Option names can technically be in any language (just tested with Cyrillic characters too), so I'm not sure the lang="en" attribute is appropriate. Otherwise, this looks good to me.

@sabernhardt
2 years ago

removes uppercase, adds code class, escapes HTML consistently

#3 in reply to: ↑ 2 @sabernhardt
2 years ago

I'm not sure the lang="en" attribute is appropriate.

I removed the language.

#4 @afrin29
22 months ago

This report validates that the issue can be reproduced, and the indicated patch addresses the issue.
Patch tested: https://core.trac.wordpress.org/attachment/ticket/50572/50572.1.diff
Environment
OS: macOS 12.5.1
Web Server: nginx/1.16.0
PHP: 7.4.1
WordPress: 6.2-alpha-55185
Browser: Chrome Version 108.0.5359.124
Theme: Twenty Twenty-Three
Active Plugins:
None

Actual Results
✅ Error condition occurs (reproduced).
✅ Issue resolved with this patch.
Additional Notes
Before Screenshot: https://d.pr/v/dJvc53
After Screenshot:Change Language(Bengeli) & Check: https://d.pr/v/VhT03V
On Default English Language: https://d.pr/i/HTRxMM

#5 @afshanadiya
22 months ago

  • Keywords has-testing-info has-screenshots added

This report validates, the issue can be reproduced and the indicated patch addresses the issue.
Patch tested: https://core.trac.wordpress.org/attachment/ticket/50572/50572.1.diff

Environment

  • OS: macOS 11.2.3
  • Web Server: Nginx
  • PHP: 7.4.30
  • WordPress: 6.2-alpha-54642-src
  • Browser: Chrome 109.0.5414.119
  • Theme: Twenty Twenty-Three
  • Active Plugins: No Plugins activated

Actual Results

✅ The error condition has been reproduced
✅ The Issue was resolved with this patch

Supplemental Artifacts

Before Screenshot: https://d.pr/i/wBKXnx
After Screenshot: https://d.pr/i/qbPygT

#6 @johnbillion
22 months ago

  • Keywords commit added
  • Owner changed from SergeyBiryukov to johnbillion
  • Status changed from reviewing to accepted

#7 @johnbillion
22 months ago

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

In 55408:

Networks and Sites: Remove confusing upper case for option names on Edit Site: Settings screen.

This type of transformation isn't always appropriate, especially for non-English language sites. Displaying the original option name makes it more clear what option is being changed.

Props SergeyBiryukov, sabernhardt, afrin29, afshanadiya

Fixes #50572

Note: See TracTickets for help on using tickets.