PHPackages                             themevan/cmb2-toggle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. themevan/cmb2-toggle

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

themevan/cmb2-toggle
====================

CMB@ Toggle field

1.0.2(3y ago)139MITPHPPHP &gt;=5.6

Since Jun 3Pushed 3y ago2 watchersCompare

[ Source](https://github.com/themevan/cmb2-toggle)[ Packagist](https://packagist.org/packages/themevan/cmb2-toggle)[ Docs](https://github.com/themevan/cmb2-toggle)[ RSS](/packages/themevan-cmb2-toggle/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (4)Used By (0)

CMB2 Toggle
===========

[](#cmb2-toggle)

CMB2 toggle field for CMB2 Metabox for WordPress.

Screenshot:
-----------

[](#screenshot)

[![Screenshot](screenshot.png)](screenshot.png)

Installation
------------

[](#installation)

You can install it as a plugin, or include the main file into your theme or plugin folder.

Usage:
------

[](#usage)

```
add_action( 'cmb2_admin_init', 'theme_slug_create_custom_metabox' );

function theme_slug_create_custom_metabox() {
  $prefix = '_theme_slug_';

  $cmb2_metabox = new_cmb2_box(
    array(
      'id'           => $prefix . 'sidebar_settings',
      'title'        => esc_html__( 'Sidebar Settings', 'theme-slug' ),
      'object_types' => array( 'page' ),
      'priority'     => 'high',
      'context'      => 'normal',
    )
  );

  $cmb2_metabox->add_field(
    array(
      'name'    => esc_html__( 'Enable Sidebar', 'theme-slug' ),
      'id'      => $prefix . 'enable_sidebar',
      'desc'    => esc_html__( 'Enables sidebar in the page.', 'text-domain' ),
      'type'    => 'toggle',
      'default' => 'on', // If it is checked by default.
    )
  );
}
```

- Example usage of the toggle field:

```
$enable_sidebar = get_post_meta( $post->ID, '_theme_slug_enable_sidebar', true );

if ( 'on' === $enable_sidebar ){
  // Do something when it is checked;
}
```

Follow Us
---------

[](#follow-us)

- [Website](https://themevan.com/)
- [Twitter](https://twitter.com/themevan/)

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~7 days

Total

3

Last Release

1429d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2098823?v=4)[Nilambar Sharma](/maintainers/ernilambar)[@ernilambar](https://github.com/ernilambar)

---

Top Contributors

[![ernilambar](https://avatars.githubusercontent.com/u/2098823?v=4)](https://github.com/ernilambar "ernilambar (11 commits)")

---

Tags

theme

### Embed Badge

![Health badge](/badges/themevan-cmb2-toggle/health.svg)

```
[![Health](https://phpackages.com/badges/themevan-cmb2-toggle/health.svg)](https://phpackages.com/packages/themevan-cmb2-toggle)
```

###  Alternatives

[tgmpa/tgm-plugin-activation

TGM Plugin Activation is a PHP library that allows you to easily require or recommend plugins for your WordPress themes (and plugins).

1.8k222.5k13](/packages/tgmpa-tgm-plugin-activation)[qirolab/laravel-themer

A Laravel theme manager, that will help you organize and maintain your themes inside Laravel projects.

402240.2k8](/packages/qirolab-laravel-themer)[freemius/wordpress-sdk

Freemius WordPress SDK

303101.4k4](/packages/freemius-wordpress-sdk)[ttskch/select2-bootstrap4-theme

Select2 v4 theme for Bootstrap4

43424.6k2](/packages/ttskch-select2-bootstrap4-theme)[david-griffiths/nova-dark-theme

A dark theme for Laravel Nova

71576.9k](/packages/david-griffiths-nova-dark-theme)[appsero/client

Appsero Client

25431.7k9](/packages/appsero-client)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
