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.
Contents
Parameters
- $stylesheet
(string)(Required)The stylesheet name.
Return
(string) Sanitized stylesheet.
Source
File: wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php
public function _sanitize_stylesheet_callback( $stylesheet ) { return urldecode( $stylesheet ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
5.9.0 | Introduced. |