wordpress / latest / classes / wp_rest_controller / sanitize_slug.html

WP_REST_Controller::sanitize_slug( string $slug ): string

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. View all references

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

Uses

Uses Description

Changelog

Version Description
4.7.0 Introduced.

© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_rest_controller/sanitize_slug