Opened 3 years ago
Last modified 2 years ago
#13835 reopened feature request
XLM-RPC API should return commentmeta values
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | low | Milestone: | Future Release |
| Component: | XML-RPC | Version: | 2.9 |
| Severity: | minor | Keywords: | has-patch needs-testing |
| Cc: | djr, n.prasath.002@… |
Description
This ticket is a follow up on my Twitter and subsequently email conversation with Joseph Scott (josephscott) about the new commentmeta table in WordPress 2.9 and the XML-RPC API. We use the plugin Feature Comments (http://wpprogrammer.com/feature-comments-wordpress-plugin/) for hiding or featuring certain comments. The plugin stores either a value of 'Buried' or 'Featured' in the commentmeta table and uses these values to append a css class to comment_class.
I'd love to retrieve these commentmeta values (buried/features) through the XML-RPC API (which we use) with wp.GetComment or wp.GetComments, so we're able to programmatically hide or feature these comments in our own iPhone app.
Please note this is a specific example, but my request should I no way be seen as a private request. I think the commentmeta in 2.9 was a great addition for stuff like Twitter usernames, mood, gender, and so forth. I hope we're able to retrieve these values programmaticaly through the API as well.
Attachments (1)
Change History (13)
- Keywords needs-patch added; xml-rpc commentmeta api removed
- Milestone changed from Unassigned to Future Release
- Version changed from 2.9.2 to 2.9
nprasath002 — 2 years ago
comment:4
nprasath002 — 2 years ago
- Cc n.prasath.002@… added
- Keywords has-patch added; needs-patch removed
- Keywords has-patch needs-testing added; needs-patch removed
- Version changed from 2.9 to 3.1
Scratch that, apparently you can leave $key blank to have the function return everything. Looks good.
comment:7
follow-up:
↓ 8
aaroncampbell — 2 years ago
- Version changed from 3.1 to 2.9
Please don't change the version on the ticket. The version is used to track the version when the error first occurred.
Replying to aaroncampbell:
The version is used to track the version when the error first occurred.
Considering this is a feature request and not a bug fix, should we be patching and reporting against trunk? It's not an error ... but a requested API enhancement for a feature introduced in 2.9.
Replying to ericmann:
Considering this is a feature request and not a bug fix, should we be patching and reporting against trunk?
Yes, always patch against trunk.
It's not an error ... but a requested API enhancement for a feature introduced in 2.9.
The version field is for the earliest applicable version of a report. Generally for bugs, but works for enhancements just fine too. Version 2.9 is appropriate here as that's when commentmeta came into play.
comment:10
nprasath002 — 2 years ago
- Resolution set to fixed
- Status changed from new to closed
THe documentation for get_comment_meta is not complete as the key value and the boolean is optional.
i created a ticket for that here
http://core.trac.wordpress.org/ticket/16965
Also i normally test with a java client and print to see whether i,m
getting the expected results
should i removed needs testing??
P.S - i,m nt getting any updates about this ticket via email. how can i do that
comment:11
nprasath002 — 2 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
comment:12
dd32 — 2 years ago
P.S - i,m nt getting any updates about this ticket via email. how can i do that
Ensure your email is listed in the preferences and check the CC box when making a reply.

That patch won't work.
get_comment_meta() takes in more than just the comment id. You also need to specify the key you're retrieving. Here's the full function from the source:
function get_comment_meta($comment_id, $key, $single = false) { return get_metadata('comment', $comment_id, $key, $single); }$single is optional (and not needed in this case), but $key is not. At the very minimum, you'd have to loop through and get all the keys so you could retrieve all the comment meta.