Summery Summery

Checks for a valid value for the reassign parameter when deleting users.

Syntax Syntax

WP_REST_Users_Controller::check_reassign( int|bool $value, WP_REST_Request $request, string $param )

Description Description

The value can be an integer, ‘false’, false, or ”.

Parameters Parameters


(int|bool) (Required) The value passed to the reassign parameter.


(WP_REST_Request) (Required) Full details about the request.


(string) (Required) The parameter that is being sanitized.

Return Return


Source Source

File: wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php

	public function check_reassign( $value, $request, $param ) {
		if ( is_numeric( $value ) ) {
			return $value;

		if ( empty( $value ) || false === $value || 'false' === $value ) {
			return false;

		return new WP_Error(
			__( 'Invalid user parameter(s).' ),
			array( 'status' => 400 )


Changelog Changelog

Version Description
4.7.0 Introduced.


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.