sanitize_html_class
sanitize_html_class ( $classname, $fallback = '' )
Parameters:- (string) classname The classname to be sanitized.
- (string) fallback Optional. The value to return if the sanitization ends up as an empty string. Default empty string.
Returns:- (string) The sanitized value.
Defined at: - Introduced in WordPress: 2.8.0
- Deprecated in WordPress: —
Description
Sanitizes an HTML classname to ensure it only contains valid characters.Strips the string down to A-Z,a-z,0-9,_,-. If this results in an empty
string then it will return the alternative value supplied.