Make WordPress Core

Opened 15 years ago

Closed 14 years ago

#12904 closed enhancement (fixed)

get_comments(): Enable post_status, post_type

Reported by: zeo's profile zeo Owned by: jorbin's profile jorbin
Milestone: 3.2 Priority: normal
Severity: normal Version:
Component: Comments Keywords: needs-patch
Focuses: Cc:

Description

To better extend and improve get_comments() to be use in various ways. Enable get_comments() to retrieve comments based on post 'post status', or post 'post type'.

Currently, even with comment 'status' = approve, it will fetch all comments regardless of 'post status' or 'post type'.

Thoughts?

Attachments (1)

get_comments.diff (1.6 KB) - added by zeo 15 years ago.
refresh patch

Download all attachments as: .zip

Change History (14)

#1 @nacin
15 years ago

  • Keywords early added
  • Milestone changed from 3.0 to 3.1

Patch is doing a bit too much work. We have various helper functions here that can help: get_post_stati, get_post_types, wp_parse_args|str, etc.

#2 @zeo
15 years ago

  • Keywords needs-patch added; has-patch removed

@zeo
15 years ago

refresh patch

#3 @zeo
15 years ago

  • Keywords needs-refresh dev-feedback needs-testing added

#4 @zeo
15 years ago

  • Cc zeo@… added

#5 @zeo
15 years ago

  • Milestone changed from 3.1 to 3.0

This ticket need early attention, because of this changeset [14483]. Even though the comment in Private, or Draft? post is not accessible but it still appear in Recent Comments listing.

#6 @nacin
15 years ago

  • Keywords early needs-refresh dev-feedback needs-testing removed

Patch still does too much work. See also wp_parse_args.

#7 @zeo
15 years ago

nacin, obviously you got it. Feel free to fix this. Thanks.

#8 @jorbin
15 years ago

  • Cc aaron@… added
  • Owner set to jorbin
  • Status changed from new to assigned

I'm going to take a crack at this now.

#9 follow-up: @nacin
15 years ago

  • Milestone changed from 3.0 to 3.1

#10 in reply to: ↑ 9 @jorbin
15 years ago

It's to late in the process for 3.0 to modify the get_comments query. This will need some early attention in the 3.1 cycle to make sure there are no performance penalties

#11 @nacin
14 years ago

  • Milestone changed from Awaiting Triage to Future Release

#12 @ryan
14 years ago

  • Milestone changed from Future Release to 3.2

#13 @ryan
14 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [17667]) Allow retrieving comments by post type, status, author, author, name, or parent. Fetch only published posts for recent comments widget. Props filosofo. fixes #16506 #12904

Note: See TracTickets for help on using tickets.