WordPress.org

Make WordPress Core

Ticket #38962: 38962.diff

File 38962.diff, 922 bytes (added by jeremyfelt, 3 years ago)
  • src/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php

     
    676676                $reassign = isset( $request['reassign'] ) ? absint( $request['reassign'] ) : null;
    677677                $force    = isset( $request['force'] ) ? (bool) $request['force'] : false;
    678678
     679                // We don't support delete requests in multisite.
     680                if ( is_multisite() ) {
     681                        return new WP_Error( 'rest_cannot_delete', __( 'The user cannot be deleted.' ), array( 'status' => 500 ) );
     682                }
     683
    679684                // We don't support trashing for users.
    680685                if ( ! $force ) {
    681686                        return new WP_Error( 'rest_trash_not_supported', __( 'Users do not support trashing. Set force=true to delete.' ), array( 'status' => 501 ) );