sanitize_title
Filters a sanitized title string.
Usage
add_filter( 'sanitize_title', 'wp_kama_sanitize_title_filter', 10, 3 ); /** * Function for `sanitize_title` filter-hook. * * @param string $title Sanitized title. * @param string $raw_title The title prior to sanitization. * @param string $context The context for which the title is being sanitized. * * @return string */ function wp_kama_sanitize_title_filter( $title, $raw_title, $context ){ // filter... return $title; }
- $title(string)
- Sanitized title.
- $raw_title(string)
- The title prior to sanitization.
- $context(string)
- The context for which the title is being sanitized.
Changelog
Since 1.2.0 | Introduced. |
Where the hook is called
sanitize_title
wp-includes/formatting.php 2223
$title = apply_filters( 'sanitize_title', $title, $raw_title, $context );
Where the hook is used in WordPress
wp-includes/default-filters.php 299
add_filter( 'sanitize_title', 'sanitize_title_with_dashes', 10, 3 );