Make WordPress Core

Opened 23 months ago

Closed 23 months ago

Last modified 21 months ago

#44840 closed enhancement (fixed)

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

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


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

Download all attachments as: .zip

Change History (6)

23 months ago

#1 @mukesh27
23 months ago

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

#2 @SergeyBiryukov
23 months ago

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

#3 @SergeyBiryukov
23 months 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
21 months ago

  • Milestone changed from 5.0 to 5.1

#5 @johnbillion
21 months ago

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