WP_REST_Themes_Controller::_sanitize_stylesheet_callback() WordPress Method

The WP_REST_Themes_Controller::_sanitize_stylesheet_callback() is used to sanitize the theme stylesheet input. This is necessary because the stylesheet is used to load the theme. It is important to ensure that the stylesheet is clean and does not contain any malicious code.

WP_REST_Themes_Controller::_sanitize_stylesheet_callback( string $stylesheet ) #

Sanitize the stylesheet to decode endpoint.


Parameters

$stylesheet

(string)(Required)The stylesheet name.


Top ↑

Return

(string) Sanitized stylesheet.


Top ↑

Source

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

	public function _sanitize_stylesheet_callback( $stylesheet ) {
		return urldecode( $stylesheet );
	}

Top ↑

Changelog

Changelog
VersionDescription
5.9.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.