WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#37187 closed defect (bug) (fixed)

Get rid of unnecessary property being set in `WP_Comment_Query`

Reported by: flixos90 Owned by: SergeyBiryukov
Milestone: 4.6 Priority: normal
Severity: normal Version: 4.4
Component: Comments Keywords: has-patch commit
Focuses: Cc:

Description

WP_Comment_Query sets an unnecessary property $comment_count. It's not defined as a class member nor is it documented anywhere. It seems like it accidentally got there, maybe when parts of the code were copied from WP_Query (as this one actually has a $comment_count property which makes sense there).

Attachments (1)

37187.diff (544 bytes) - added by flixos90 3 years ago.

Download all attachments as: .zip

Change History (5)

@flixos90
3 years ago

#1 @flixos90
3 years ago

  • Keywords has-patch added; needs-patch removed

37187.diff removes the line.

#2 @ocean90
3 years ago

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

#3 @SergeyBiryukov
3 years ago

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

In 37873:

Comments: Remove the assignment of an undocumented $comment_count property in WP_Comment_Query::get_comments(), which appears to be accidentally introduced in [34544].

Props flixos90.
Fixes #37187.

#4 @SergeyBiryukov
3 years ago

  • Version changed from 3.1 to 4.4
Note: See TracTickets for help on using tickets.