WP_REST_Themes_Controller::sanitize_theme_status()publicWP 5.0.0

Deprecated from version 5.7.0. It is no longer supported and can be removed in future releases. It is recommended to replace this function with the same one.

Sanitizes and validates the list of theme status.

Method of the class: WP_REST_Themes_Controller{}

No Hooks.


Array|WP_Error. A list of valid statuses, otherwise WP_Error object.


$WP_REST_Themes_Controller = new WP_REST_Themes_Controller();
$WP_REST_Themes_Controller->sanitize_theme_status( $statuses, $request, $parameter );
$statuses(string|array) (required)
One or more theme statuses.
$request(WP_REST_Request) (required)
Full details about the request.
$parameter(string) (required)
Additional parameter to pass to validation.


Since 5.0.0 Introduced.
Deprecated since 5.7.0

WP_REST_Themes_Controller::sanitize_theme_status() code WP 6.4.1

public function sanitize_theme_status( $statuses, $request, $parameter ) {
	_deprecated_function( __METHOD__, '5.7.0' );

	$statuses = wp_parse_slug_list( $statuses );

	foreach ( $statuses as $status ) {
		$result = rest_validate_request_arg( $status, $request, $parameter );

		if ( is_wp_error( $result ) ) {
			return $result;

	return $statuses;