sanitize_title_for_query()WP 3.1.0

Sanitizes a title with the 'query' context.

Used for querying the database for a value from URL.

1 time — 0.000071 sec (very fast) | 50000 times — 0.90 sec (very fast)

No Hooks.

Return

String. The sanitized string.

Usage

sanitize_title_for_query( $title );
$title(string) (required)
The string to be sanitized.

Changelog

Since 3.1.0 Introduced.

Code of sanitize_title_for_query() WP 6.0

function sanitize_title_for_query( $title ) {
	return sanitize_title( $title, '', 'query' );
}