mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
Allow passing sustitution args to prepare() as an array. Makes building queries for prepare easier.
git-svn-id: http://svn.automattic.com/wordpress/trunk@10721 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
33de670823
commit
34d455832d
@ -502,6 +502,9 @@ class wpdb {
|
||||
return;
|
||||
$args = func_get_args();
|
||||
$query = array_shift($args);
|
||||
// If args were passed as an array, move them up
|
||||
if ( is_array($args[0]) )
|
||||
$args = $args[0];
|
||||
$query = str_replace("'%s'", '%s', $query); // in case someone mistakenly already singlequoted it
|
||||
$query = str_replace('"%s"', '%s', $query); // doublequote unquoting
|
||||
$query = str_replace('%s', "'%s'", $query); // quote the strings
|
||||
|
Loading…
Reference in New Issue
Block a user