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