sanitize_title WordPress Filter Hook

The sanitize_title hook is used to sanitize a title before it is used. This is useful for making sure that a title is valid before it is saved to the database or displayed on the front end.

apply_filters( 'sanitize_title', string $title, string $raw_title, string $context ) #

Filters a sanitized title string.


Parameters

$title

(string)Sanitized title.

$raw_title

(string)The title prior to sanitization.

$context

(string)The context for which the title is being sanitized.


Top ↑

More Information

sanitize_title is a filter applied to a value to be cleaned up for use in a URL by the function sanitize_title()


Top ↑

Source

File: wp-includes/formatting.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
1.2.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by the Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More