public function get_value_of($option) { if ($option === 'currency_symbol') { return $this->get_currency_symbol(); } if ($option === 'senders_email_formatted') { $disp_name = $this->get_value_of('senders_display_name'); $sender_mail = $this->get_value_of('senders_email'); if ($disp_name && $sender_mail) { $str = $disp_name . " <" . $sender_mail . ">"; } elseif ($disp_name && !$sender_mail) { $str = $disp_name; } elseif (!$disp_name && $sender_mail) { $str = $sender_mail; } elseif (!$disp_name && !$sender_mail) { $str = $this->default['senders_display_name'] . " <" . $this->default['senders_email'] . ">"; } return $str; } //To be on safe side, also prepend prefix before using the option name. $prefixed_option = strtolower($this->prefix . $option); $value = get_option($prefixed_option, null); //If option is not in database try to load default value. if (null === $value) { return isset($this->default[$option]) ? $this->default[$option] : null; } else { if ($option === 'smtp_password' && $value) { $value = RM_Utilities::dec_str($value); } elseif ($option === 'admin_email' && trim($value) === '') { $value = $this->default[$option]; } elseif ($option === 'allowed_file_types' && trim($value) === '') { $value = $this->default[$option]; } elseif ($option === 'payment_gateway') { $value = $this->default['payment_gateway']; } return $value; } }