Skip to main content

GV\Settings

A generic Settings base class.

Source: future/includes/class-gv-settings.php:12

Details

  • Kind: class
  • Namespace: GV

Methods

MethodDescription
__construct()Create with new.
update()Mass update values from the allowed ones.
set()Set a setting.
get()Set an setting.
all()Returns all the objects in this collection as an an array.

Method Reference

__construct()

public function __construct( $settings=[] )

Create with new.

Parameters

NameTypeDefaultDescription
$settingsarray[]Initial settings. Default: none.

Returns

Since: 2.0

Source: future/includes/class-gv-settings.php:27

update()

public function update( $settings )

Mass update values from the allowed ones.

Parameters

NameTypeDefaultDescription
$settingsarrayAn array of settings to update.

Returns

Since: 2.0

Source: future/includes/class-gv-settings.php:42

set()

public function set( $key, $value )

Set a setting.

Parameters

NameTypeDefaultDescription
$keymixedThe key the value should be added under.
$valuemixedThe value to be added to the key.

Returns

  • void

Since: 2.0

Source: future/includes/class-gv-settings.php:59

get()

public function get( $key, $default=null )

Set an setting.

Parameters

NameTypeDefaultDescription
$keymixedThe key in this setting to retrieve.
$defaultmixednullA default in case the key is not set.

Returns

  • mixed | null

Since: 2.0

Source: future/includes/class-gv-settings.php:73

all()

public function all()

Returns all the objects in this collection as an an array.

Returns

  • array — The objects in this collection.

Since: 2.0

Source: future/includes/class-gv-settings.php:84