OPTIONS

Options

Options are the way to store extension-related settings that have an impact on a company. All the data is stored in the options table and mapped with the company_id. Here is the columns options table has.

Structure of the miniCal options Table

The options table has a similar structure to the metadata tables. It has five fields:

  • option_ID

  • company_id- Current company id.

  • option_name- Name of an option (key).

  • option_value- Value of option (value).

  • autoload - Whether to load the option when extension starts up. Default is enabled. The boolean value true/false.

Each record in the option_name field will be a unique value: if you add more than one value to an option, miniCal stores this in an array in the option_value field.

// Add a new option.
add_option(string $option, $value = '', bool $autoload = true)

// Removes option by name.
delete_option( string $option )

// Retrieves an option value based on an option name.
get_option( string $option, bool $default = false)

// Update the value of an option that was already added.
update_option( string $option, $value = '', bool $autoload = true )

Using the Options

The Options consists of four functions that allow you to add, get, update or delete options:

Last updated