Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#44840 closed enhancement (fixed)

Don't assign to a variable inside if statement in get_post_format()

Reported by: mirucon's profile Mirucon Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 5.1 Priority: normal
Severity: minor Version:
Component: Post Formats Keywords: has-patch needs-testing commit
Focuses: coding-standards Cc:

Description

Currently in the get_post_format() function, there's variable assign inside if statement. It is not a really good practice since assigning to a variable inside could confuse people as it looks like a mistake of the comparison operator. This patch will assign to a new variable just before the line of if().

Attachments (1)

44840.patch (440 bytes) - added by Mirucon 6 years ago.

Download all attachments as: .zip

Change History (6)

@Mirucon
6 years ago

#1 @mukesh27
6 years ago

  • Component changed from General to Post Formats
  • Focuses coding-standards added
  • Keywords needs-testing added

#2 @SergeyBiryukov
6 years ago

  • Keywords commit added
  • Milestone changed from Awaiting Review to 5.0

#3 @SergeyBiryukov
6 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 43592:

Post Formats: Don't assign a variable inside if statement in get_post_format().

Props Mirucon.
Fixes #44840.

#4 @johnbillion
6 years ago

  • Milestone changed from 5.0 to 5.1

#5 @johnbillion
6 years ago

  • Version trunk deleted
Note: See TracTickets for help on using tickets.