sanitize_title_for_query
Sanitizes a title with the 'query' context.
Description
(string) sanitize_title_for_query( (string) $title );
Used for querying the database for a value from URL.
Returns (string)
The sanitized string.
Parameters (1)
- 0. $title (string)
- The string to be sanitized.
Usage
if ( !function_exists( 'sanitize_title_for_query' ) ) { require_once ABSPATH . WPINC . '/formatting.php'; } // The string to be sanitized. $title = ''; // NOTICE! Understand what this does before running. $result = sanitize_title_for_query($title);
Defined (1)
The function is defined in the following location(s).
- /wp-includes/formatting.php
- function sanitize_title_for_query( $title ) {
- return sanitize_title( $title, '', 'query' );
- }