Make WordPress Core

Opened 16 months ago

Closed 3 months ago

#56951 closed defect (bug) (invalid)

Incorrect use of class in wp-admin fields

Reported by: phillsav's profile phillsav Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Administration Keywords:
Focuses: css, administration, coding-standards Cc:

Description (last modified by sabernhardt)

in wp-admin/options-general.php and profile.php we are using the class 'regular-text code' to display the text in the Website field. However in other url field instances, we use the 'regular-text' class.

See Here: https://prnt.sc/wQ7zuSY-pWRX

This seems incorrect, for example in wp-admin/profile.php, we have a list of url fields beginning with the website url. The website field is the only one which uses this 'regular-text code' class. It looks unusual to differ between the url classes in this way:

I found this page which also contradicts the use of 'regular-text code' for a url:

Reference
https://make.wordpress.org/docs/style-guide/developer-content/code-in-text/#items-to-put-in-regular-non-code-font

Therefore, is the usage of this class correct? If not, i'm happy to be assigned to contribute the fix for this, if it is indeed classed as incorrect.

Attachments (1)

incorrect font.png (101.8 KB) - added by phillsav 16 months ago.
showing the font classes used

Download all attachments as: .zip

Change History (4)

@phillsav
16 months ago

showing the font classes used

#1 follow-up: @sabernhardt
16 months ago

  • Component changed from General to Administration
  • Description modified (diff)
  • Keywords close 2nd-opinion added

Hi and thanks for the report!

The style guide page describes how to style "Code in text"; these are input fields. For the "Website" field, the regular-text class sets the input width, and the code class gives it the fixed-width font and text direction.

"Facebook profile URL" is not a Core profile field, but it seems to be from Yoast SEO. You could open an issue (and/or pull request) to suggest adding the code class to each profile URL field and probably changing the type from text to url.
https://github.com/Yoast/wordpress-seo/issues

#2 in reply to: ↑ 1 @phillsav
16 months ago

Hello @sabernhardt and thank you for your prompt reply.

Yes, you are correct, the additional fields have been generated from the Yoast Seo plugin.

I will raise this with Yoast Seo and issue a PR to fix in line with core styles.

Replying to sabernhardt:

Hi and thanks for the report!

The style guide page describes how to style "Code in text"; these are input fields. For the "Website" field, the regular-text class sets the input width, and the code class gives it the fixed-width font and text direction.

"Facebook profile URL" is not a Core profile field, but it seems to be from Yoast SEO. You could open an issue (and/or pull request) to suggest adding the code class to each profile URL field and probably changing the type from text to url.
https://github.com/Yoast/wordpress-seo/issues

#3 @SergeyBiryukov
3 months ago

  • Keywords close 2nd-opinion removed
  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

Thanks for the follow-up!

Closing, as this appears to be a plugin issue, and there are no actional items for WordPress core here at this time.

Note: See TracTickets for help on using tickets.