Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#44840 closed enhancement (fixed)

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

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

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 8 years ago.

Download all attachments as: .zip

Change History (6)

#1 @mukesh27
8 years ago

  • Component General → Post Formats
  • Focuses coding-standards added
  • Keywords needs-testing added

#2 @SergeyBiryukov
8 years ago

  • Keywords commit added
  • Milestone Awaiting Review → 5.0

#3 @SergeyBiryukov
8 years ago

  • Owner set to SergeyBiryukov
  • Resolution → fixed
  • Status new → closed

In 43592:

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

Props Mirucon.
Fixes #44840.

#4 @johnbillion
8 years ago

  • Milestone 5.0 → 5.1

#5 @johnbillion
8 years ago

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