Comments: add comment history endpoint#8222
Conversation
|
What's the use-case for this? Why are we adding it? |
This is for the Comment View: Automattic/wp-calypso#19772 |
|
@kwight here's some background: |
| } | ||
|
|
||
| if ( ! class_exists( 'Akismet' ) || ! method_exists( 'Akismet', 'get_comment_history' ) ) { | ||
| return new WP_Error( 'akismet_required', 'Akismet plugin must be active for this feature to work', 501 ); |
There was a problem hiding this comment.
Is this a server or a client error in this case? Would it make more sense to choose a 4xx response since the plugin needs to be enabled?
There was a problem hiding this comment.
The way I see it - the client is sending a valid request that would otherwise succeed (503 might be more appropriate here). I'm open to other suggestions in terms of exact 4xx code that we should return.
There was a problem hiding this comment.
I'd vote for 503 (or 418, because it's fun 😜).
These just look like the regular values returned from the PHP's
These are custom Akismet events that also show up in wp-admin's history (so not user generated). |
zinigor
left a comment
There was a problem hiding this comment.
Read, tested, seems to work as it should!
* Changelog 5.6: create base for changelog. * Update changelog with 5.5.1 info. * Changelog: add #7930 and #8238 * Changelog: add #8076 * Changelog: add #8100 * Changelog: add #8117 * Changelog: add #8141 * Changelog: add #8143 * Changelog: add #8147 * Changelog: add #8149 * Changelog: add #8153 * Changelog: add #8173 * Changelog: add #8184 * Changelog: add #8196 * Changelog: add #8199 * Changelog: add #8093 * Changelog: add #8171 * Changelog: add #8182 * Changelog: add #8202, #8222 * Changelog: add #8228 * Changelog: add #8240 * Changelog: add #8251 * remove AL card change

Depends on D8410-code.
Add endpoint that will return comment history for given comment id.
This functionality relies on Akismet plugin.
Testing instructions
define( ‘JETPACK__API_BASE’, ‘https://hostname.wordpress.com/jetpack.’ );https://public-api.wordpress.com/rest/v1/sites/{site_slug}/comment-history/{comment_id}