diff options
Diffstat (limited to 'plugins/jetpack/json-endpoints/class.wpcom-json-api-update-comment-endpoint.php')
-rw-r--r-- | plugins/jetpack/json-endpoints/class.wpcom-json-api-update-comment-endpoint.php | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/plugins/jetpack/json-endpoints/class.wpcom-json-api-update-comment-endpoint.php b/plugins/jetpack/json-endpoints/class.wpcom-json-api-update-comment-endpoint.php index d60d541f..a5056472 100644 --- a/plugins/jetpack/json-endpoints/class.wpcom-json-api-update-comment-endpoint.php +++ b/plugins/jetpack/json-endpoints/class.wpcom-json-api-update-comment-endpoint.php @@ -21,6 +21,8 @@ new WPCOM_JSON_API_Update_Comment_Endpoint( array( 'pass_wpcom_user_details' => true, + 'allow_fallback_to_jetpack_blog_token' => true, + 'example_request' => 'https://public-api.wordpress.com/rest/v1/sites/82974409/posts/843/replies/new/', 'example_request_data' => array( 'headers' => array( @@ -52,6 +54,8 @@ new WPCOM_JSON_API_Update_Comment_Endpoint( array( 'pass_wpcom_user_details' => true, + 'allow_fallback_to_jetpack_blog_token' => true, + 'example_request' => 'https://public-api.wordpress.com/rest/v1/sites/82974409/comments/29/replies/new', 'example_request_data' => array( 'headers' => array( @@ -227,13 +231,12 @@ class WPCOM_JSON_API_Update_Comment_Endpoint extends WPCOM_JSON_API_Comment_Endp $user->ID = 0; } + $author = get_user_by( 'id', (int) $user->ID ); // If we have a user with an external ID saved, we can use it. if ( ! $auth_required && $user->ID - && ( - $author = get_user_by( 'id', intval( $user->ID ) ) - ) + && $author ) { $user = $author; } @@ -254,7 +257,7 @@ class WPCOM_JSON_API_Update_Comment_Endpoint extends WPCOM_JSON_API_Comment_Endp 'comment_author_url' => $user->user_url, 'comment_content' => $input['content'], 'comment_parent' => $comment_parent_id, - 'comment_type' => '', + 'comment_type' => 'comment', ); if ( $comment_parent_id ) { |