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
2759publicfunctiondelete($table,$where,$where_format=null){2760if(!is_array($where)){2761returnfalse;2762}27632764$where=$this->process_fields($table,$where,$where_format);2765if(false===$where){2766returnfalse;2767}27682769$conditions=array();2770$values=array();2771foreach($whereas$field=>$value){2772if(is_null($value['value'])){2773$conditions[]="`$field` IS NULL";2774continue;2775}27762777$conditions[]="`$field` = ".$value['format'];2778$values[]=$value['value'];2779}27802781$conditions=implode(' AND ',$conditions);27822783$sql="DELETE FROM `$table` WHERE $conditions";27842785$this->check_current_query=false;2786return$this->query($this->prepare($sql,$values));2787}
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 6.7.7 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.