Docs: Correct usage examples for `wpdb::prepare()`, which should not be called statically.
Props TJNowell. Fixes #37744. Built from https://develop.svn.wordpress.org/trunk@38289 git-svn-id: http://core.svn.wordpress.org/trunk@38230 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
d30a6a988a
commit
597c067b67
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.7-alpha-38288';
|
||||
$wp_version = '4.7-alpha-38289';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
|
@ -1258,8 +1258,8 @@ class wpdb {
|
|||
*
|
||||
* Both %d and %s should be left unquoted in the query string.
|
||||
*
|
||||
* wpdb::prepare( "SELECT * FROM `table` WHERE `column` = %s AND `field` = %d", 'foo', 1337 )
|
||||
* wpdb::prepare( "SELECT DATE_FORMAT(`field`, '%%c') FROM `table` WHERE `column` = %s", 'foo' );
|
||||
* $wpdb->prepare( "SELECT * FROM `table` WHERE `column` = %s AND `field` = %d", 'foo', 1337 );
|
||||
* $wpdb->prepare( "SELECT DATE_FORMAT(`field`, '%%c') FROM `table` WHERE `column` = %s", 'foo' );
|
||||
*
|
||||
* @link https://secure.php.net/sprintf Description of syntax.
|
||||
* @since 2.3.0
|
||||
|
|
Loading…
Reference in New Issue