[wp-trac] [WordPress Trac] #43929: Privacy pages: buttons should be buttons and other coding standards

WordPress Trac noreply at wordpress.org
Wed May 2 11:50:56 UTC 2018


#43929: Privacy pages: buttons should be buttons and other coding standards
------------------------------+--------------------
 Reporter:  afercia           |      Owner:  (none)
     Type:  defect (bug)      |     Status:  new
 Priority:  normal            |  Milestone:  4.9.6
Component:  Administration    |    Version:  trunk
 Severity:  normal            |   Keywords:
  Focuses:  coding-standards  |
------------------------------+--------------------
 Starting with [42986] and following commits, a few buttons were added in
 the Privacy pages, to allow users export and remove their personal data.
 These buttons are actually links with a `href="#"` attribute (9
 occurrences).

 As per the accessibility standards
 (https://make.wordpress.org/core/handbook/best-practices/coding-standards
 /accessibility-coding-standards/#semantics-for-controls) these links
 should be real buttons:
 `<button type="button" ...`

 Worth noting the `type="button"` attribute allows to not use
 `event.preventDefault()` as there's no default action to prevent.

 ===

 CSS selectors:

 As per the CSS coding standards (https://make.wordpress.org/core/handbook
 /best-practices/coding-standards/css/#selectors) words should be separated
 with hyphens, however many selectors in these pages use underscores:

 > https://make.wordpress.org/core/handbook/best-practices/coding-
 standards/css/#selectors

 ===
 JavaSCript variable declarations with `var`

 As per the JavaScript coding standards
 (https://make.wordpress.org/core/handbook/best-practices/coding-
 standards/javascript/#declaring-variables-with-var), multiple `var` `var`
 `var` declarations should be avoided:
 > Each function should begin with a single comma-delimited var statement
 that declares any local variables necessary.

 I know this is going to change, but the current standards are very clear.
 I'd say either update the coding standards, or meet them :)

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/43929>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list