public function update($field, $value) { if (isset($this->ID)) { update_post_meta($this->ID, $field, $value); $this->{$field} = $value; } }