sanitize_html_class
Filters a sanitized HTML class string.
Usage
add_filter( 'sanitize_html_class', 'wp_kama_sanitize_html_class_filter', 10, 3 ); /** * Function for `sanitize_html_class` filter-hook. * * @param string $sanitized The sanitized HTML class. * @param string $classname HTML class before sanitization. * @param string $fallback The fallback string. * * @return string */ function wp_kama_sanitize_html_class_filter( $sanitized, $classname, $fallback ){ // filter... return $sanitized; }
- $sanitized(string)
- The sanitized HTML class.
- $classname(string)
- HTML class before sanitization.
- $fallback(string)
- The fallback string.
Changelog
Since 2.8.0 | Introduced. |
Where the hook is called
sanitize_html_class
wp-includes/formatting.php 2436
return apply_filters( 'sanitize_html_class', $sanitized, $classname, $fallback );