WPCOM_JSON_API_Get_Comment_Endpoint

The Jetpack by WordPress.com WPCOM JSON API Get Comment Endpoint class.

Defined (1)

The class is defined in the following location(s).

/json-endpoints/class.wpcom-json-api-get-comment-endpoint.php  
  1. class WPCOM_JSON_API_Get_Comment_Endpoint extends WPCOM_JSON_API_Comment_Endpoint { 
  2. // /sites/%s/comments/%d -> $blog_id, $comment_id 
  3. function callback( $path = '', $blog_id = 0, $comment_id = 0 ) { 
  4. $blog_id = $this->api->switch_to_blog_and_validate_user( $this->api->get_blog_id( $blog_id ) ); 
  5. if ( is_wp_error( $blog_id ) ) { 
  6. return $blog_id; 
  7.  
  8. $args = $this->query_args(); 
  9.  
  10. $return = $this->get_comment( $comment_id, $args['context'] ); 
  11. if ( !$return || is_wp_error( $return ) ) { 
  12. return $return; 
  13.  
  14. /** This action is documented in json-endpoints/class.wpcom-json-api-site-settings-endpoint.php */ 
  15. do_action( 'wpcom_json_api_objects', 'comments' ); 
  16.  
  17. return $return;