Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#22901 closed defect (bug) (invalid)

wp.getComments doesn't accept an array of statuses anymore.

Reported by: stuffmc's profile stuffmc Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.5
Component: XML-RPC Keywords:
Focuses: Cc:


Between 2.7 and 3.5 Beta I could not only give a status as a text but as well as an array, allowing to retrieve in one call the "hold" and "approve" comments. As of 3.5 final, sending an array of statuses returns an empty array of comments.

Change History (7)

#1 @nacin
12 years ago

  • Milestone changed from Awaiting Review to 3.5.1

Moving to 3.5.1 for investigation.

#2 @markoheijnen
12 years ago

This issue is quite interesting. From looking to the code I can't see the reason why it ever worked. Also Codex says it is string only.

#3 @nacin
12 years ago

Interesting. So, this is actually a change in WP_Comment_Query.

If you passed 'status' as an array — any array — prior to 3.5, you would have gotten comments that were "hold" (0) and "approve" (1). That's it. Even if you asked for something else.

In 3.5, what now occurs is when you pass a 'status', we query for that status. Problem is, you're passing an array, which is getting cast to Array. So, comment_status = 'Array'. That doesn't work.

This is due to the changes in #21101.

If you stop requesting 'status', wp.getComments will again return hold and approve for you.

#4 @markoheijnen
12 years ago

That was exactly what how he tries to do it: user, pwd, {number:1, status: ["approve", "hold"]}

#5 @stuffmc
12 years ago

Interesting. so it means if I want to retrieve 3 statuses I need to send 3 XML-RPC queries? :(

Last edited 12 years ago by stuffmc (previous) (diff)

#6 @markoheijnen
12 years ago

Well it are 2 queries then. One for approve/hold and one for spam.

You do can use the method 'system.MultiCall'. Quick search let me to this page:

#7 @markoheijnen
12 years ago

  • Milestone 3.5.1 deleted
  • Resolution set to invalid
  • Severity changed from major to normal
  • Status changed from new to closed

Closing the ticket as invalid since this was never possible. Was thinking about creating a new ticket for having it possible but for me it doesn't make sense if you can't have a custom status.

@stuffmc: For your application I would split approve/hold and spam. It makes no sense to have those combined from an user perspective.

Note: See TracTickets for help on using tickets.