Title: WP_REST_Abilities_V1_Run_Controller::input_contains_error
Published: August 20, 2026

---

# WP_REST_Abilities_V1_Run_Controller::input_contains_error( mixed $value ): bool

## In this article

 * [Parameters](https://developer.wordpress.org/reference/classes/wp_rest_abilities_v1_run_controller/input_contains_error/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/classes/wp_rest_abilities_v1_run_controller/input_contains_error/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/classes/wp_rest_abilities_v1_run_controller/input_contains_error/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/wp_rest_abilities_v1_run_controller/input_contains_error/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_rest_abilities_v1_run_controller/input_contains_error/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/wp_rest_abilities_v1_run_controller/input_contains_error/?output_format=md#wp--skip-link--target)

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](https://developer.wordpress.org/reference/classes/wp_error/).

## 󠀁[Parameters](https://developer.wordpress.org/reference/classes/wp_rest_abilities_v1_run_controller/input_contains_error/?output_format=md#parameters)󠁿

 `$value`mixedrequired

The value to inspect.

## 󠀁[Return](https://developer.wordpress.org/reference/classes/wp_rest_abilities_v1_run_controller/input_contains_error/?output_format=md#return)󠁿

 bool True if the value is, or contains, a [WP_Error](https://developer.wordpress.org/reference/classes/wp_error/).

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_rest_abilities_v1_run_controller/input_contains_error/?output_format=md#source)󠁿

    ```php
    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;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-abilities-v1-run-controller.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/rest-api/endpoints/class-wp-rest-abilities-v1-run-controller.php#L316)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/rest-api/endpoints/class-wp-rest-abilities-v1-run-controller.php#L316-L330)

## 󠀁[Related](https://developer.wordpress.org/reference/classes/wp_rest_abilities_v1_run_controller/input_contains_error/?output_format=md#related)󠁿

| Uses | Description | 
| [WP_REST_Abilities_V1_Run_Controller::input_contains_error()](https://developer.wordpress.org/reference/classes/wp_rest_abilities_v1_run_controller/input_contains_error/)`wp-includes/rest-api/endpoints/class-wp-rest-abilities-v1-run-controller.php` |

Determines whether a sanitized value is, or contains, a [WP_Error](https://developer.wordpress.org/reference/classes/wp_error/).

  | 
| [is_wp_error()](https://developer.wordpress.org/reference/functions/is_wp_error/)`wp-includes/load.php` |

Checks whether the given variable is a WordPress Error.

  |

| Used by | Description | 
| [WP_REST_Abilities_V1_Run_Controller::coerce_input_to_schema()](https://developer.wordpress.org/reference/classes/wp_rest_abilities_v1_run_controller/coerce_input_to_schema/)`wp-includes/rest-api/endpoints/class-wp-rest-abilities-v1-run-controller.php` |

Coerces raw request input to the types declared in the ability input schema.

  | 
| [WP_REST_Abilities_V1_Run_Controller::input_contains_error()](https://developer.wordpress.org/reference/classes/wp_rest_abilities_v1_run_controller/input_contains_error/)`wp-includes/rest-api/endpoints/class-wp-rest-abilities-v1-run-controller.php` |

Determines whether a sanitized value is, or contains, a [WP_Error](https://developer.wordpress.org/reference/classes/wp_error/).

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/wp_rest_abilities_v1_run_controller/input_contains_error/?output_format=md#changelog)󠁿

| Version | Description | 
| [7.1.0](https://developer.wordpress.org/reference/since/7.1.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_rest_abilities_v1_run_controller%2Finput_contains_error%2F)
before being able to contribute a note or feedback.