/** * Save the field value(s) into the database. * * @param Field $field The field to save. */ public function save(Field $field) { $name = $field->get_name(); $autoload = $field->get_autoload() ? 'yes' : 'no'; // Add value to the cache, so that add_option always works $notoptions = wp_cache_get('notoptions', 'options'); $notoptions[$name] = ''; wp_cache_set('notoptions', $notoptions, 'options'); if (!add_option($name, $field->get_value(), null, $autoload)) { update_option($name, $field->get_value()); } }
/** * Save the field value(s) into the database. * * @param Field $field The field to save. */ public function save(Field $field) { $this->store_data[$field->get_name()] = $field->get_value(); }
/** * Delete the field value(s) from the database. * * @param Field $field The field to delete. */ public function delete(Field $field) { delete_user_meta($this->user_id, $field->get_name(), $field->get_value()); }
/** * Delete the field value(s) from the database. * * @param Field $field The field to delete. */ public function delete(Field $field) { delete_metadata('term', $this->term_id, $field->get_name(), $field->get_value()); }
/** * Delete the field value(s) from the database. * * @param Field $field The field to delete. */ public function delete(Field $field) { delete_post_meta($this->post_id, $field->get_name(), $field->get_value()); }