nsrosenqvist/cmb2-switch

This package is abandoned and no longer maintained. No replacement package was suggested.

Installs: 50

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:wordpress-plugin

1.0.1 2018-06-19 09:37 UTC

This package is auto-updated.

Last update: 2020-06-09 20:10:09 UTC


README

A boolean switch field type for CMB2.

$analytics = new_cmb2_box(array(
    'id'            => 'analytics',
    'title'         => __('Analytics', 'theme'),
));

$analytics_state = $analytics->add_field(array(
    'name' => __( 'Enable Analytics?', 'theme'),
    'id'   => 'analytics_state',
    'type'    => 'switch',
    'default' => cmb2_set_switch_default(true),
));