-
Notifications
You must be signed in to change notification settings - Fork 800
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd vote for 503 (or 418, because it's fun 😜).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
503 it is then 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in a38b95b.
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). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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}