WP_REST_Themes_Controller::sanitize_theme_status( string|array $statuses, WP_REST_Request $request, string $parameter ): array|WP_Error

In this article

This method has been deprecated.

Sanitizes and validates the list of theme status.

Parameters

$statusesstring|arrayrequired
One or more theme statuses.
$requestWP_REST_Requestrequired
Full details about the request.
$parameterstringrequired
Additional parameter to pass to validation.

Return

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

Source

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

Changelog

VersionDescription
5.7.0This method has been deprecated.
5.0.0Introduced.

User Contributed Notes

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