function delete_values(Carbon_Field $field) { $field_name = $field->get_name(); foreach ($this->store_data as $key => $value) { if (strpos($key, $field_name) === 0) { unset($this->store_data[$key]); } } }
function delete_values(Carbon_Field $field) { global $wpdb; $group_names = $field->get_group_names(); $field_name = $field->get_name(); $meta_key_constraint = '`meta_key` LIKE "' . $field_name . implode('-%" OR `meta_key` LIKE "' . $field_name, $group_names) . '-%"'; return $wpdb->query(' DELETE FROM ' . $wpdb->usermeta . ' WHERE (' . $meta_key_constraint . ') AND `user_id`="' . intval($this->user_id) . '" '); }