summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/jetpack/json-endpoints/class.wpcom-json-api-comment-endpoint.php')
-rw-r--r--plugins/jetpack/json-endpoints/class.wpcom-json-api-comment-endpoint.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/plugins/jetpack/json-endpoints/class.wpcom-json-api-comment-endpoint.php b/plugins/jetpack/json-endpoints/class.wpcom-json-api-comment-endpoint.php
index 74562322..7d25d7aa 100644
--- a/plugins/jetpack/json-endpoints/class.wpcom-json-api-comment-endpoint.php
+++ b/plugins/jetpack/json-endpoints/class.wpcom-json-api-comment-endpoint.php
@@ -24,9 +24,10 @@ abstract class WPCOM_JSON_API_Comment_Endpoint extends WPCOM_JSON_API_Endpoint {
'trackback' => 'The comment is a trackback.',
'pingback' => 'The comment is a pingback.',
),
- 'like_count' => '(int) The number of likes for this comment.',
- 'i_like' => '(bool) Does the current user like this comment?',
- 'meta' => '(object) Meta data',
+ 'like_count' => '(int) The number of likes for this comment.',
+ 'i_like' => '(bool) Does the current user like this comment?',
+ 'meta' => '(object) Meta data',
+ 'can_moderate' => '(bool) Whether current user can moderate the comment.',
);
// public $response_format =& $this->comment_object_format;
@@ -192,6 +193,9 @@ abstract class WPCOM_JSON_API_Comment_Endpoint extends WPCOM_JSON_API_Endpoint {
),
);
break;
+ case 'can_moderate':
+ $response[ $key ] = (bool) current_user_can( 'edit_comment', $comment_id );
+ break;
}
}