sanitize_title_for_query() WordPress Function
The sanitize_title_for_query() function is a WordPress core function that is used to sanitize a string for use in a SQL query. The function is located in wp-includes/formatting.php.
sanitize_title_for_query( string $title ) #
Sanitizes a title with the ‘query’ context.
Description
Used for querying the database for a value from URL.
Parameters
- $title
(string)(Required)The string to be sanitized.
Return
(string) The sanitized string.
More Information
Usage:
sanitize_title_for_query( $title );
Notes:
Since sanitize_title_for_query()
calls sanitize_title(), the sanitize_title filter is applied with a context of ‘query’.
Source
File: wp-includes/formatting.php
function sanitize_title_for_query( $title ) { return sanitize_title( $title, '', 'query' ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
3.1.0 | Introduced. |