Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#38422 closed defect (bug) (duplicate)

Twenty Seventeen: Coding Style

Reported by: aaroncampbell Owned by: davidakennedy
Milestone: Priority: normal
Severity: normal Version: 4.7
Component: Bundled Theme Keywords: has-patch
Focuses: Cc:


I'd like to see this kind of variable assignment changed to a standard if.

740 <= $width && $sizes = '(max-width: 706px) 89vw, (max-width: 767px) 82vw, 740px';

We don't use that style anywhere else.

Attachments (1)

38442.diff (1.1 KB) - added by aaroncampbell 4 years ago.

Download all attachments as: .zip

Change History (6)

4 years ago

#1 @aaroncampbell
4 years ago

  • Owner set to davidakennedy
  • Status changed from new to assigned

Patch attached, assigning to @davidakennedy to take a look.

#2 @ocean90
4 years ago

  • Milestone 4.7 deleted
  • Resolution set to duplicate
  • Status changed from assigned to closed

Duplicate of #38384.

#3 @mor10
4 years ago

The current formatting is based on what's in Twenty Sixteen. I wonder if there was a reason for this particular structure.

#4 @aaroncampbell
4 years ago

It looks like it happened in this commit but has no reference to why the change from the classic if() {} to the unused test && $var = 'value';

Honestly, it's not as easy to read, it's not as standard, and it doesn't happen anywhere else in core. To me, that's enough to change it.

#5 @SergeyBiryukov
4 years ago

  • Summary changed from Coding Style in TwentySeventeen to Twenty Seventeen: Coding Style
Note: See TracTickets for help on using tickets.