diff options
Diffstat (limited to 'plugins/jetpack/json-endpoints/class.wpcom-json-api-update-user-endpoint.php')
-rw-r--r-- | plugins/jetpack/json-endpoints/class.wpcom-json-api-update-user-endpoint.php | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/plugins/jetpack/json-endpoints/class.wpcom-json-api-update-user-endpoint.php b/plugins/jetpack/json-endpoints/class.wpcom-json-api-update-user-endpoint.php index e08e8810..ef5cb2d8 100644 --- a/plugins/jetpack/json-endpoints/class.wpcom-json-api-update-user-endpoint.php +++ b/plugins/jetpack/json-endpoints/class.wpcom-json-api-update-user-endpoint.php @@ -1,4 +1,38 @@ <?php + +new WPCOM_JSON_API_Update_User_Endpoint( array( + 'description' => 'Deletes or removes a user of a site.', + 'group' => 'users', + 'stat' => 'users:delete', + + 'method' => 'POST', + 'path' => '/sites/%s/users/%d/delete', + 'path_labels' => array( + '$site' => '(int|string) The site ID or domain.', + '$user_ID' => '(int) The user\'s ID' + ), + + 'request_format' => array( + 'reassign' => '(int) An optional id of a user to reassign posts to.', + ), + + 'response_format' => array( + 'success' => '(bool) Was the deletion of user successful?', + ), + + 'example_request' => 'https://public-api.wordpress.com/rest/v1/sites/82974409/users/1/delete', + 'example_request_data' => array( + 'headers' => array( + 'authorization' => 'Bearer YOUR_API_TOKEN' + ), + ), + + 'example_response' => ' + { + "success": true + }' +) ); + class WPCOM_JSON_API_Update_User_Endpoint extends WPCOM_JSON_API_Endpoint { function callback( $path = '', $blog_id = 0, $user_id = 0 ) { |