WP_REST_Controller::sanitize_slug( string $slug )
Sanitizes the slug value.
Description
See also
Parameters
- $slug
-
(string) (Required) Slug value passed in request.
Return
(string) Sanitized value for the slug.
Source
File: wp-includes/rest-api/endpoints/class-wp-rest-controller.php
public function sanitize_slug( $slug ) { return sanitize_title( $slug ); }
Changelog
Version | Description |
---|---|
4.7.0 | Introduced. |
© 2003–2021 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_rest_controller/sanitize_slug