| Conditions | 4 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 18 |
| Ratio | 100 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 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 ) ); |
||
|
|
|||
| 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 |