W3cubDocs

/WordPress

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

Sanitizes and validates the list of theme status.

Parameters

$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.

Return

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

Source

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

public function sanitize_theme_status( $statuses, $request, $parameter ) {
		$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

Version Description
5.0.0 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_rest_themes_controller/sanitize_theme_status