wppaste
WordPress

apply_filters( 'sanitize_html_class', string $sanitized, string $classname, string $fallback )

Since
2.8.0
Filters a sanitized HTML class string.

Compatibility

WordPress
since 2.8.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Parameters

$sanitizedstring
The sanitized HTML class.
$classnamestring
HTML class before sanitization.
$fallbackstring
The fallback string.

Where this hook fires · 1

  • wp-includes/formatting.php:2446sanitize_html_class()

Source code

	 * @since 2.8.0	 *	 * @param string $sanitized The sanitized HTML class.	 * @param string $classname HTML class before sanitization.	 * @param string $fallback  The fallback string.	 */	return apply_filters( 'sanitize_html_class', $sanitized, $classname, $fallback );} /** * Strips out all characters not allowed in a locale name. * * @since 6.2.1

Changelog

Introduced in 2.8.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 6.8.8 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.