WP_REST_Controller::sanitize_slug()
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 REST Controller::sanitize slug WP 5.9.3
public function sanitize_slug( $slug ) { return sanitize_title( $slug ); }