[wp-trac] [WordPress Trac] #26467: Twenty Fourteen: Errant \ in page.php

WordPress Trac noreply at wordpress.org
Sat Dec 7 00:36:02 UTC 2013


#26467: Twenty Fourteen: Errant \ in page.php
------------------------------+-----------------------
 Reporter:  Ipstenu           |       Owner:  nacin
     Type:  defect (bug)      |      Status:  reopened
 Priority:  normal            |   Milestone:  3.8
Component:  Bundled Theme     |     Version:  trunk
 Severity:  normal            |  Resolution:
 Keywords:  has-patch commit  |
------------------------------+-----------------------

Comment (by nacin):

 Generally speaking, we use braces whenever we remain entirely within PHP,
 and alternative style when we're breaking in and out of PHP. It seems in
 this case moving to braces makes sense. In themes, it is additionally
 always used for the loop, and the while is usually on the same line as
 the_post(). For two-line if statements, there's basically no reason to use
 alternative style.

 There's not a lot of consistency when looking through the default themes,
 in terms of alternative style in templates. In Twenty Fourteen, about a
 third of if statements in templates use braces, a third use alternative
 syntax then immediately break out of PHP (proper), and another third use
 alternative syntax then stay in PHP (ideally not used).

--
Ticket URL: <http://core.trac.wordpress.org/ticket/26467#comment:9>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list