WordPress.org

Make WordPress Core

Opened 3 months ago

Last modified 3 months ago

#43496 new defect (bug)

CS: Fix disabled for user-edit.php

Reported by: mukesh27 Owned by:
Milestone: 5.0 Priority: normal
Severity: normal Version: 4.1
Component: Users Keywords: has-patch
Focuses: coding-standards Cc:

Description

Many apologies if this is a duplicate. I have searched but did not find it yet posted.

According to W3C specifications and as per HTML Coding Standards( https://make.wordpress.org/core/handbook/best-practices/coding-standards/html/#quotes ) handbook all attributes must have a value, and must use double or single-quotes.

Attachments (2)

43496.patch (706 bytes) - added by mukesh27 3 months ago.
43496.2.patch (1.0 KB) - added by mukesh27 3 months ago.

Download all attachments as: .zip

Change History (10)

@mukesh27
3 months ago

#1 @mukesh27
3 months ago

  • Keywords has-patch added

#2 @netweb
3 months ago

  • Keywords commit added
  • Milestone changed from Awaiting Review to 5.0
  • Version set to 4.1

Thanks @mukesh27, spot on 👍

#3 follow-ups: @ocean90
3 months ago

  • Keywords commit removed

Since the admin doesn't use XHTML I'm not sure why we have to add a value to boolean attributes. The rule should probably be changed to exclude boolean attributes.

There are few other occurrences of disabled and also readonly without a value.

#4 in reply to: ↑ 3 @mukesh27
3 months ago

So needs to resolve all occurrences also if that coding part is not needed then we have to removed that.

Replying to ocean90:

Since the admin doesn't use XHTML I'm not sure why we have to add a value to boolean attributes. The rule should probably be changed to exclude boolean attributes.

There are few other occurrences of disabled and also readonly without a value.

Last edited 3 months ago by mukesh27 (previous) (diff)

@mukesh27
3 months ago

#5 in reply to: ↑ 3 ; follow-up: @netweb
3 months ago

Replying to ocean90:

Since the admin doesn't use XHTML I'm not sure why we have to add a value to boolean attributes. The rule should probably be changed to exclude boolean attributes.

Right, thanks, @ocean90 👍 , can you update the handbook to reflect this in the most appropriate way you think possible pelase 😃

#6 in reply to: ↑ 5 @GaryJ
3 months ago

Replying to netweb:

Replying to ocean90:

Since the admin doesn't use XHTML I'm not sure why we have to add a value to boolean attributes. The rule should probably be changed to exclude boolean attributes.

Right, thanks, @ocean90 👍 , can you update the handbook to reflect this in the most appropriate way you think possible pelase 😃

I'd like to think that would require a WPCS RFC or more discussion than just "should probably" :-)

#7 follow-up: @afercia
3 months ago

Worth reminding in core we can use HTML5 so all boolean attributes like disabled shouldn't use a value. Using just disabled is enough.

#8 in reply to: ↑ 7 @GaryJ
3 months ago

Replying to afercia:

Worth reminding in core we can use HTML5 so all boolean attributes like disabled shouldn't use a value. Using just disabled is enough.

Please see https://core.trac.wordpress.org/ticket/22249#comment:54.

Note: See TracTickets for help on using tickets.