Automattic /
jetpack
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
| 1 | <?php |
||
| 2 | |||
| 3 | class WPCOM_JSON_API_Get_Comment_Endpoint extends WPCOM_JSON_API_Comment_Endpoint { |
||
| 4 | // /sites/%s/comments/%d -> $blog_id, $comment_id |
||
| 5 | View Code Duplication | function callback( $path = '', $blog_id = 0, $comment_id = 0 ) { |
|
| 6 | $blog_id = $this->api->switch_to_blog_and_validate_user( $this->api->get_blog_id( $blog_id ) ); |
||
|
0 ignored issues
–
show
Coding Style
introduced
by
Loading history...
|
|||
| 7 | if ( is_wp_error( $blog_id ) ) { |
||
| 8 | return $blog_id; |
||
| 9 | } |
||
| 10 | |||
| 11 | $args = $this->query_args(); |
||
| 12 | |||
| 13 | $return = $this->get_comment( $comment_id, $args['context'] ); |
||
| 14 | if ( !$return || is_wp_error( $return ) ) { |
||
| 15 | return $return; |
||
| 16 | } |
||
| 17 | |||
| 18 | /** This action is documented in json-endpoints/class.wpcom-json-api-site-settings-endpoint.php */ |
||
| 19 | do_action( 'wpcom_json_api_objects', 'comments' ); |
||
| 20 | |||
| 21 | return $return; |
||
| 22 | } |
||
| 23 | } |
||
| 24 |