/** * get_option function. * * Gets and option from the settings API, using defaults if necessary to prevent undefined notices. * * @param string $key * @param mixed $empty_value * @return mixed The value specified for the option or a default value for the option. */ public function get_option($key, $empty_value = null) { // Instance options take priority over global options if (in_array($key, array_keys($this->get_instance_form_fields()))) { return $this->get_instance_option($key, $empty_value); } // Return global option return parent::get_option($key, $empty_value); }
protected function get_var($key, $empty_value = null) { $option = ''; if (is_null($empty_value)) { $empty_value = $this->get_field_default($key); } if (is_bool($empty_value)) { $option = isset($this->settings[$key]) ? $this->settings[$key] == 'yes' ? true : false : $empty_value; } else { $option = parent::get_option($key, $empty_value); } return $option; }