Make WordPress Core

Changeset 41660


Ignore:
Timestamp:
10/02/2017 12:21:06 AM (7 years ago)
Author:
pento
Message:

Docs: Clarify the docs for wpdb::prepare().

Make the usage of the % wildcard in queries clearer.

Props jrf.
Fixes #41983.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/wp-db.php

    r41632 r41660  
    12021202     * All placeholders MUST be left unquoted in the query string. A corresponding argument MUST be passed for each placeholder.
    12031203     *
    1204      * Literal percentage signs (%) in the query string must be written as %%. Percentage wildcards (for example, to use in LIKE syntax)
    1205      * must be passed in the string argument, it cannot be inserted in the query string.
     1204     * Literal percentage signs (%) in the query string must be written as %%. Percentage wildcards (for example,
     1205     * to use in LIKE syntax) must be passed via a substitution argument containing the complete LIKE string, these
     1206     * cannot be inserted directly in the query string. Also see {@see esc_like()}.
    12061207     *
    12071208     * This method DOES NOT support sign, padding, alignment, width or precision specifiers.
Note: See TracChangeset for help on using the changeset viewer.