WP_REST_Controller::sanitize_slug()publicWP 4.7.0

Sanitizes the slug value.

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.

WP_REST_Controller::sanitize_slug() code WP 6.6.2

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