WordPress.org

Make WordPress Core

Opened 17 months ago

Closed 5 months ago

#44395 closed enhancement (duplicate)

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

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

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 17 months ago.

Download all attachments as: .zip

Change History (2)

#1 @pento
5 months 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.