Make WordPress Core

Opened 6 years ago

Closed 5 years ago

#44395 closed enhancement (duplicate)

PHPCS: Assignment must be the first block of code on a line

Reported by: subrataemfluence's profile subrataemfluence Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: General Keywords: has-patch
Focuses: administration, coding-standards Cc:

Description

File: /wp-admin/custom-background.php
Line number: 259

Code block as of now:

<?php
if ( $bgcolor = get_background_color() ) {
   $background_styles .= 'background-color: #' . $bgcolor . ';';
}

Modified code:

<?php
$bgcolor = get_background_color();
if ( '' !== $bgcolor ) {
   $background_styles .= 'background-color: #' . $bgcolor . ';';
}

Please let me know if the proposed patch works.

Attachments (1)

44395.diff (491 bytes) - added by subrataemfluence 6 years ago.

Download all attachments as: .zip

Change History (2)

#1 @pento
5 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #47632.

Note: See TracTickets for help on using tickets.