WP_REST_Abilities_V1_Run_Controller::input_contains_error( mixed $value ): bool

In this article

This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only by core. It is listed here for completeness.

Determines whether a sanitized value is, or contains, a WP_Error.

Parameters

$valuemixedrequired
The value to inspect.

Return

bool True if the value is, or contains, a WP_Error.

Source

private function input_contains_error( $value ): bool {
	if ( is_wp_error( $value ) ) {
		return true;
	}

	if ( is_array( $value ) ) {
		foreach ( $value as $item ) {
			if ( $this->input_contains_error( $item ) ) {
				return true;
			}
		}
	}

	return false;
}

Changelog

VersionDescription
7.1.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.