WooCommerce Code Reference

WC_Helper_Options
in package

WC_Helper_Options Class

An interface to the woocommerce_helper_data entry in the wp_options table.

Table of Contents

$option_name  : string
The option name used to store the helper data.
get()  : mixed
Get an option by key
update()  : bool
Update an option by key

Properties

Methods

get()

Get an option by key

public static get(string $key[, mixed $default = false ]) : mixed
Parameters
$key : string

The key to fetch.

$default : mixed = false

The default option to return if the key does not exist.

Tags
see
self::update
Return values
mixedAn option or the default.

update()

Update an option by key

public static update(string $key, mixed $value) : bool

All helper options are grouped in a single options entry. This method is not thread-safe, use with caution.

Parameters
$key : string

The key to update.

$value : mixed

The new option value.

Return values
boolTrue if the option has been updated.