Warning: This method has been deprecated.

WP_REST_Themes_Controller::sanitize_theme_status() WordPress Method

The WP_REST_Themes_Controller::sanitize_theme_status() is used to sanitize a theme status prior to updating a theme.

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.


Top ↑

Return

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


Top ↑

Source

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

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


Top ↑

Changelog

Changelog
VersionDescription
5.7.0This method has been deprecated.
5.0.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.