[wp-trac] [WordPress Trac] #41057: Update PHP codebase per WordPress PHP Coding Standards

WordPress Trac noreply at wordpress.org
Mon Sep 4 06:44:36 UTC 2017


#41057: Update PHP codebase per WordPress PHP Coding Standards
----------------------------+-----------------------
 Reporter:  netweb          |       Owner:  pento
     Type:  task (blessed)  |      Status:  accepted
 Priority:  normal          |   Milestone:  4.9
Component:  General         |     Version:
 Severity:  normal          |  Resolution:
 Keywords:                  |     Focuses:
----------------------------+-----------------------

Comment (by peterwilsoncc):

 Replying to [comment:59 pento]:
 > For embedded HTML, I don't know if we can automatically split - adding
 whitespace between elements can cause layout bugs, but adding whitespace
 inside of elements (ie, putting element attributes on separate lines)
 won't.
 >
 > [... snip]
 >
 > And for HTML elements, should we split at every attribute, or just the
 ones we need to? Should we put newlines between all elements where there
 was previously no whitespace, just a specific set of elements, or should
 we throw a warning?

 Please don't make any meaningful changes to white-space, any instances of
 HTML tags butted against each other will need to remain. It will mainly
 cause problems with the inline & inline-block display types, see
 https://jsbin.com/jewayex/edit?html,css,output

 With very few exceptions, a developer can set any type of element to any
 type of display type. For some history, a meaningful change to white-space
 lead to #35107 & reverting [34321].

 For instances where two HTML tags have some white-space between them,
 these can be tidied up with line breaks and tabs to meet the coding
 standards. This would be dandy.

 For breaking at attributes, I'd suggest only where needed as any line
 breaks that make it into the rendered HTML will make it less readable.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/41057#comment:61>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list