WP_REST_Controller::sanitize_slugpublicWP 4.7.0

Sanitizes the slug value.

{@internal We can't use sanitize_title() directly, as the second parameter is the fallback title, which would end up being set to the request object.}

Метод класса: WP_REST_Controller{}

Хуков нет.

Возвращает

Строку. Sanitized value for the slug.

Использование

$WP_REST_Controller = new WP_REST_Controller();
$WP_REST_Controller->sanitize_slug( $slug );
$slug(строка) (обязательный)
Slug value passed in request.

Список изменений

С версии 4.7.0 Введена.

Код WP_REST_Controller::sanitize_slug() WP 7.0.2

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