WordPress at a glance
function is not described

WP_REST_Controller::sanitize_slug() public WP 4.7.0

Sanitizes the slug value.

{} It's a method of the class: WP_REST_Controller{}

No Hooks.

Return

String. Sanitized value for the slug.

Usage

$WP_REST_Controller = new WP_REST_Controller();
$WP_REST_Controller->sanitize_slug( $slug );
$slug(string) (required)
Slug value passed in request.

Notes

Changelog

Since 4.7.0 Introduced.

Code of WP_REST_Controller::sanitize_slug() WP 5.5.1

<?php
public function sanitize_slug( $slug ) {
	return sanitize_title( $slug );
}