WordPress.org

Make WordPress Core

Changeset 10721


Ignore:
Timestamp:
03/05/09 22:15:17 (7 years ago)
Author:
ryan
Message:

Allow passing sustitution args to prepare() as an array. Makes building queries for prepare easier.

File:
1 edited

Legend:

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

    r10604 r10721  
    503503        $args = func_get_args(); 
    504504        $query = array_shift($args); 
     505        // If args were passed as an array, move them up 
     506        if ( is_array($args[0]) ) 
     507            $args = $args[0]; 
    505508        $query = str_replace("'%s'", '%s', $query); // in case someone mistakenly already singlequoted it 
    506509        $query = str_replace('"%s"', '%s', $query); // doublequote unquoting 
Note: See TracChangeset for help on using the changeset viewer.