-
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 counts endpoint #8202
Conversation
Add endpoint that will return comment counts for each available status on a given site. Optionally, these results are filterable by post_id parameter.
return new WP_Error( 'authorization_required', 'An active access token must be used to retrieve comment counts.', 403 ); | ||
} | ||
|
||
if ( ! current_user_can_for_blog( $blog_id, 'moderate_comments' ) ) { |
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.
So moderate_comments is sadly not used anyplace but an obscure ajax endpoint for wp-admin. Automattic/wp-calypso#17687
The corner case to check for is an Author who has a post with some comments. In wp-admin I should be able to see full counts, but only be able to moderate comments on their posts. In this case I think we need to switch this check to 'edit_posts'
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 bb1606d.
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.
Tested with D8370 -- works and looks great!
* 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 D8370-code.
Closes: Automattic/wp-calypso#19477
Add endpoint that will return comment counts for each available status on a given site. Optionally, these results are filterable by post_id parameter.
Testing instructions:
define( ‘JETPACK__API_BASE’, ‘https://hostname.wordpress.com/jetpack.’ )
.post_id
parameter with the request and verify that the results are filtered by post.