Remove redundant "db_" from db_insert() and db_update() methods. Now just insert() and update(). see #5178
git-svn-id: http://svn.automattic.com/wordpress/trunk@6238 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
05e68a8676
commit
1d883e1b9c
|
@ -704,10 +704,10 @@ function wp_insert_post($postarr = array()) {
|
||||||
$data = stripslashes_deep( $data );
|
$data = stripslashes_deep( $data );
|
||||||
|
|
||||||
if ($update) {
|
if ($update) {
|
||||||
$wpdb->db_update( $wpdb->posts, $data, 'ID', $post_ID );
|
$wpdb->update( $wpdb->posts, $data, 'ID', $post_ID );
|
||||||
} else {
|
} else {
|
||||||
$data['post_mime_type'] = stripslashes( $post_mime_type ); // This isn't in the update
|
$data['post_mime_type'] = stripslashes( $post_mime_type ); // This isn't in the update
|
||||||
$wpdb->db_insert( $wpdb->posts, $data );
|
$wpdb->insert( $wpdb->posts, $data );
|
||||||
$post_ID = (int) $wpdb->insert_id;
|
$post_ID = (int) $wpdb->insert_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1294,9 +1294,9 @@ function wp_insert_attachment($object, $file = false, $parent = 0) {
|
||||||
$data = stripslashes_deep( $data );
|
$data = stripslashes_deep( $data );
|
||||||
|
|
||||||
if ($update) {
|
if ($update) {
|
||||||
$wpdb->db_update($wpdb->posts, $data, 'ID', $post_ID);
|
$wpdb->update($wpdb->posts, $data, 'ID', $post_ID);
|
||||||
} else {
|
} else {
|
||||||
$wpdb->db_insert($wpdb->posts, $data);
|
$wpdb->insert($wpdb->posts, $data);
|
||||||
$post_ID = (int) $wpdb->insert_id;
|
$post_ID = (int) $wpdb->insert_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -256,7 +256,7 @@ class wpdb {
|
||||||
* @param array $data should not already be SQL-escaped
|
* @param array $data should not already be SQL-escaped
|
||||||
* @return mixed results of $this->query()
|
* @return mixed results of $this->query()
|
||||||
*/
|
*/
|
||||||
function db_insert($table, $data) {
|
function insert($table, $data) {
|
||||||
$data = add_magic_quotes($data);
|
$data = add_magic_quotes($data);
|
||||||
$fields = array_keys($data);
|
$fields = array_keys($data);
|
||||||
return $this->query("INSERT INTO $table (`" . implode('`,`',$fields) . "`) VALUES ('".implode("','",$data)."')");
|
return $this->query("INSERT INTO $table (`" . implode('`,`',$fields) . "`) VALUES ('".implode("','",$data)."')");
|
||||||
|
@ -270,7 +270,7 @@ class wpdb {
|
||||||
* @param string $where_val the value of the WHERE statement. Should not already be SQL-escaped.
|
* @param string $where_val the value of the WHERE statement. Should not already be SQL-escaped.
|
||||||
* @return mixed results of $this->query()
|
* @return mixed results of $this->query()
|
||||||
*/
|
*/
|
||||||
function db_update($table, $data, $where_col, $where_val){
|
function update($table, $data, $where_col, $where_val){
|
||||||
$data = add_magic_quotes($data);
|
$data = add_magic_quotes($data);
|
||||||
$bits = array();
|
$bits = array();
|
||||||
foreach ( array_keys($data) as $k )
|
foreach ( array_keys($data) as $k )
|
||||||
|
|
Loading…
Reference in New Issue