wpdb::add_placeholder_escape( string $query ): string

In this article

Adds a placeholder escape string, to escape anything that resembles a printf() placeholder.

Parameters

$querystringrequired
The query to escape.

Return

string The query with the placeholder escape string inserted where necessary.

Source

public function add_placeholder_escape( $query ) {
	/*
	 * To prevent returning anything that even vaguely resembles a placeholder,
	 * we clobber every % we can find.
	 */
	return str_replace( '%', $this->placeholder_escape(), $query );
}

Changelog

VersionDescription
4.8.3Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.