From ea23ff3422cfa73be82d7013713e3464a7d753fd Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Mon, 2 Oct 2017 00:21:06 +0000 Subject: [PATCH] Docs: Clarify the docs for `wpdb::prepare()`. Make the usage of the `%` wildcard in queries clearer. Props jrf. Fixes #41983. git-svn-id: https://develop.svn.wordpress.org/trunk@41660 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/wp-db.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/wp-db.php b/src/wp-includes/wp-db.php index 89af746988..5ed0673bee 100644 --- a/src/wp-includes/wp-db.php +++ b/src/wp-includes/wp-db.php @@ -1201,8 +1201,9 @@ class wpdb { * * All placeholders MUST be left unquoted in the query string. A corresponding argument MUST be passed for each placeholder. * - * Literal percentage signs (%) in the query string must be written as %%. Percentage wildcards (for example, to use in LIKE syntax) - * must be passed in the string argument, it cannot be inserted in the query string. + * Literal percentage signs (%) in the query string must be written as %%. Percentage wildcards (for example, + * to use in LIKE syntax) must be passed via a substitution argument containing the complete LIKE string, these + * cannot be inserted directly in the query string. Also see {@see esc_like()}. * * This method DOES NOT support sign, padding, alignment, width or precision specifiers. * This method DOES NOT support argument numbering or swapping.