WordPress at Your Fingertips
function is not described

wpdb::add_placeholder_escape() public WP 4.8.3

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

{} It's a method of the class: wpdb{}

No Hooks.


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


global $wpdb;
$wpdb->add_placeholder_escape( $query );
$query(string) (required)
The query to escape.


Since 4.8.3 Introduced.

Code of wpdb::add_placeholder_escape() WP 5.7.2

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 );