PHPackages                             cehojac/cmb2-field-order - 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. cehojac/cmb2-field-order

ActiveCmb2-addon[Utility &amp; Helpers](/categories/utility)

cehojac/cmb2-field-order
========================

Custom field for CMB2 to store custom order of options.

013PHP

Since Jun 4Pushed 6y agoCompare

[ Source](https://github.com/cehojac/cmb2-field-order)[ Packagist](https://packagist.org/packages/cehojac/cmb2-field-order)[ RSS](/packages/cehojac-cmb2-field-order/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

CMB2 custom field "order"
=========================

[](#cmb2-custom-field-order)

Custom field for [CMB2](https://github.com/WebDevStudios/CMB2) to store custom order of options.

[![example](example.gif)](example.gif)

```
add_action( 'cmb2_admin_init', 'cmb2_order_metabox' );
function cmb2_order_metabox() {

	$prefix = 'your_prefix_demo_';

	$cmb_demo = new_cmb2_box( array(
		'id'            => $prefix . 'metabox',
		'title'         => __( 'Test Metabox', 'cmb2' ),
		'object_types'  => array( 'page', 'post' ), // Post type
		// 'show_on_cb' => 'your_prefix_show_if_front_page', // function should return a bool value
		// 'context'    => 'normal',
		// 'priority'   => 'high',
		// 'show_names' => true, // Show field names on the left
		// 'cmb_styles' => false, // false to disable the CMB stylesheet
		// 'closed'     => true, // true to keep the metabox closed by default
	) );

	$cmb_demo->add_field( array(
		'name'          => __( 'Test Order', 'cmb2' ),
		'desc'          => __( 'field description (optional)', 'cmb2' ),
		'id'            => $prefix . '_order',
		'type'          => 'order',
		// 'inline'        => true,
		'options'       => array(
			'option-1'  => __('Option 1', 'cmb2'),
			'option-2'  => __('Option 2', 'cmb2'),
			'option-3'  => __('Option 3', 'cmb2'),
		),
	) );

}
```

Changelog
---------

[](#changelog)

### 1.0.1

[](#101)

- Sortable now works on Appearance &gt;&gt; Widgets

### 1.0.0

[](#100)

- Initial commit

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 87.5% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/f47eb02703b705a42d3f4a51233a2038edc1deb9115b563628a35fac40d72150?d=identicon)[cehojac](/maintainers/cehojac)

---

Top Contributors

[![rubengc](https://avatars.githubusercontent.com/u/5462480?v=4)](https://github.com/rubengc "rubengc (7 commits)")[![cehojac](https://avatars.githubusercontent.com/u/1319696?v=4)](https://github.com/cehojac "cehojac (1 commits)")

### Embed Badge

![Health badge](/badges/cehojac-cmb2-field-order/health.svg)

```
[![Health](https://phpackages.com/badges/cehojac-cmb2-field-order/health.svg)](https://phpackages.com/packages/cehojac-cmb2-field-order)
```

###  Alternatives

[rs/laravel-version-control

Foundations for making your app version controlled. Provides migration, blueprint and base models. Will make your app GxP compliant if you exclusively use the VC models and table structure as set out in this package.

1227.5k](/packages/rs-laravel-version-control)[mad-web/laravel-seoable

Easy to map your eloquent fields to seo properties

407.6k](/packages/mad-web-laravel-seoable)

PHPackages © 2026

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