You appear to be a bot. Output may be restricted
Description
Update a row
Usage
EDD_DB::update( $row_id, $data, $where );
Parameters
- $row_id
- ( mixed ) required –
- $data
- ( mixed ) optional –
- $where
- ( mixed ) optional –
Returns
void bool
Source
File name: easy-digital-downloads/includes/class-edd-db.php
Lines:
1 to 34 of 34
public function update( $row_id, $data = array(), $where = '' ) { global $wpdb; // Row ID must be positive integer $row_id = absint( $row_id ); if( empty( $row_id ) ) { return false; } if( empty( $where ) ) { $where = $this->primary_key; } // Initialise column format array $column_formats = $this->get_columns(); // Force fields to lower case $data = array_change_key_case( $data ); // White list columns $data = array_intersect_key( $data, $column_formats ); // Reorder $column_formats to match the order of columns given in $data $data_keys = array_keys( $data ); $column_formats = array_merge( array_flip( $data_keys ), $column_formats ); if ( false === $wpdb->update( $this->table_name, $data, array( $where => $row_id ), $column_formats ) ) { return false; } return true; }