Properties

$instance

$instance : mixed

Static variable to hold the single instance of the class.

Type

mixed — Default null

$option_handle

$option_handle : string

Variable to hold the option name.

Type

string — Default option name.

$option

$option : mixed

Variable to hold the options.

Type

mixed — Options.

Methods

__construct()

__construct() 

Constructor

Runs each time the class is called.

get_option()

get_option(string  $key = null, mixed  $defval = '') : mixed

Get Option

Gets option in Databse.

Parameters

string $key

Option key.

mixed $defval

Default value.

Returns

mixed —

Retruns option value.

set_option()

set_option(string  $key, mixed  $value) : mixed

Set Option

Sets option in Databse.

Parameters

string $key

Option key.

mixed $value

Option value.

Returns

mixed —

Update option.

get_all_options()

get_all_options() : mixed

Get All Options

Gets options in Databse.

Returns

mixed —

Retruns options value.

save_options()

save_options(array  $options) : mixed

Save All Options

Parameters

array $options

Options.

Returns

mixed —

Retruns value.

cost_tracker_format_price()

cost_tracker_format_price(float  $price, boolean  $ret = false) : string

Format the price with a currency symbol.

Parameters

float $price

Raw price.

boolean $ret

Return or echo value.

Returns

string

get_separated_costs_price()

get_separated_costs_price(array  $group_prices) : string

Format the group costs prices.

Parameters

array $group_prices

Group price.

Returns

string

get_currency_symbol()

get_currency_symbol(string  $currency) : string

Method get_currency_symbol().

Parameters

string $currency

Currency.

Returns

string —

Currency symbol.

get_all_currency_symbols()

get_all_currency_symbols() : array

Method get_all_currency_symbols().

Returns

array —

Currency symbols.

default_currency_settings()

default_currency_settings() 

Get default tracker settings.

validate_currency_settings()

validate_currency_settings(array  $settings) 

Validate currency settings.

Parameters

array $settings

Settings value.