A named array of WHERE clauses (in column => value pairs). Multiple clauses will be joined with ANDs. Both $where columns and $where values should be "raw". Sending a null value will create an IS NULL comparison - the corresponding format will be ignored in this case.
$where_formatstring[]|stringoptional
An array of formats to be mapped to each of the values in $where. If string, that format will be used for all of the items in $where. A format is one of '%d', '%f', '%s' (integer, float, string). If omitted, all values in $data will be treated as strings unless otherwise specified in wpdb::$field_types. Default null.Default: null
2763publicfunctiondelete($table,$where,$where_format=null){2764if(!is_array($where)){2765returnfalse;2766}27672768$where=$this->process_fields($table,$where,$where_format);2769if(false===$where){2770returnfalse;2771}27722773$conditions=array();2774$values=array();2775foreach($whereas$field=>$value){2776if(is_null($value['value'])){2777$conditions[]="`$field` IS NULL";2778continue;2779}27802781$conditions[]="`$field` = ".$value['format'];2782$values[]=$value['value'];2783}27842785$conditions=implode(' AND ',$conditions);27862787$sql="DELETE FROM `$table` WHERE $conditions";27882789$this->check_current_query=false;2790return$this->query($this->prepare($sql,$values));2791}
History
Introduced in 3.4.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
Parsed data
Generated from the wordpress-develop 7.0.4 tag, from src/wp-includes/class-wpdb.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.