Comments: add comment counts endpoint#8202
Merged
dereksmart merged 2 commits intomasterfrom Nov 27, 2017
Merged
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.
gwwar
reviewed
Nov 17, 2017
| 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' ) ) { |
Contributor
There was a problem hiding this comment.
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'
dereksmart
approved these changes
Nov 27, 2017
Contributor
dereksmart
left a comment
There was a problem hiding this comment.
Tested with D8370 -- works and looks great!
jeherve
added a commit
that referenced
this pull request
Nov 28, 2017
oskosk
pushed a commit
that referenced
this pull request
Nov 28, 2017
* 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_idparameter with the request and verify that the results are filtered by post.