- Timestamp:
- 11/03/2016 08:04:59 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php
r39106 r39126 86 86 'args' => array( 87 87 'force' => array( 88 'type' => 'boolean', 88 89 'default' => false, 89 90 'description' => __( 'Required to be true, as resource does not support trashing.' ), … … 115 116 'args' => array( 116 117 'force' => array( 118 'type' => 'boolean', 117 119 'default' => false, 118 120 'description' => __( 'Required to be true, as resource does not support trashing.' ), … … 654 656 // We don't support trashing for this type, error out. 655 657 if ( ! $force ) { 656 return new WP_Error( 'rest_trash_not_supported', __( 'Users do not support trashing. ' ), array( 'status' => 501 ) );658 return new WP_Error( 'rest_trash_not_supported', __( 'Users do not support trashing. Set force=true to delete.' ), array( 'status' => 501 ) ); 657 659 } 658 660 … … 671 673 $request->set_param( 'context', 'edit' ); 672 674 673 $ response= $this->prepare_item_for_response( $user, $request );675 $previous = $this->prepare_item_for_response( $user, $request ); 674 676 675 677 /** Include admin user functions to get access to wp_delete_user() */ … … 681 683 return new WP_Error( 'rest_cannot_delete', __( 'The resource cannot be deleted.' ), array( 'status' => 500 ) ); 682 684 } 685 686 $response = new WP_REST_Response(); 687 $response->set_data( array( 'deleted' => true, 'previous' => $previous->get_data() ) ); 683 688 684 689 /**
Note: See TracChangeset
for help on using the changeset viewer.