/** * Get the value of a single option, or an array with all options. * * @since 1.0.0 * * @param string|bool $name Optional. Name of a single option to get, or false for all options. * @param mixed $default_value Optional. Default value, if the option $name does not exist. * @return mixed Value of the retrieved option $name, or $default_value if it does not exist, or array of all options. */ public function get($name = false, $default_value = null) { if (false === $name) { return array_merge($this->plugin_options->get(), $this->user_options->get()); } // Single Option wanted. if ($this->plugin_options->is_set($name)) { return $this->plugin_options->get($name); } elseif ($this->user_options->is_set($name)) { return $this->user_options->get($name); } else { // No valid Plugin or User Option. return $default_value; } }