WordPress.org

Make WordPress Core

#39142 closed enhancement (fixed)

Unused $_where variable after r38446 in `WP_Comment_Query::fill_descendants`

Reported by: david.binda Owned by: boonebgorges
Milestone: 4.8 Priority: normal
Severity: normal Version: 4.7
Component: Comments Keywords:
Focuses: Cc:

Description

The r38446 have removed a direct SQL query and replaced it by get_comments call. Just the $_where variable, which was used for building the direct SQL query was not removed.

Since it's not being used elsewhere in the code, it should be removed in order to improve the readability of the code.

Attachments (1)

39142.patch (1.8 KB) - added by david.binda 11 months ago.
Removing the $_where variable and moving $exclude_keys to inside conditional where it is used.

Download all attachments as: .zip

Change History (3)

@david.binda
11 months ago

Removing the $_where variable and moving $exclude_keys to inside conditional where it is used.

#1 @boonebgorges
11 months ago

  • Milestone changed from Awaiting Review to 4.8

Thanks for the patch, @david.binda! I'm going to keep the $exclude_keys definition outside the do loop, as it doesn't need to be defined more than once, but otherwise looks good.

#2 @boonebgorges
11 months ago

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

In 39532:

Comments: Clean up unused code after [38446].

When the direct SQL query was removed in [38446], part of the SQL
concatenation was not removed. This changeset fixes that.

Props david.binda.
Fixes #39142.

Note: See TracTickets for help on using tickets.