PHPackages                             webdevstudios/cmb2-user-select - 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. webdevstudios/cmb2-user-select

ActiveWordpress-plugin

webdevstudios/cmb2-user-select
==============================

Special CMB2 Field that allows users to define an autocomplete text field for users

v0.2.3(8y ago)211.3k9[2 issues](https://github.com/WebDevStudios/CMB2-User-Select/issues)1GPL-2.0+PHPPHP &gt;=5.2

Since Feb 28Pushed 7y ago26 watchersCompare

[ Source](https://github.com/WebDevStudios/CMB2-User-Select)[ Packagist](https://packagist.org/packages/webdevstudios/cmb2-user-select)[ Docs](https://github.com/WebDevStudios/CMB2-User-Select)[ RSS](/packages/webdevstudios-cmb2-user-select/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (6)Used By (1)

CMB2-User-Select
================

[](#cmb2-user-select)

Special CMB2 Field that allows users to define an autocomplete text field for users

### Example

[](#example)

```
$cmb2->add_field( array(
	'name'  => 'Author',,
	'id'    => 'author',
	'desc'  => 'Type the name of the author and select from the options',
	'type'  => 'user_select_text'
	'options' => array(
		'user_roles' => array( 'role1', 'role2' ), // Specify which roles to query for.
	),
) );
```

The value returned is an array with the users `id` and `name`, eg:

```
array(
	'id'   => 1
	'name' => 'Joe Blogs'
)
```

This will be serialised if saved directly into the database.

If you wish to store the users ID only, you can use `escape_cb` and `sanitization_cb` to transform the data.

```
/**
 * Takes the id from the database and returns an array for user_select_text
 * @param int $value
 * @return array('name' => string, 'id' => int)
 */
function id_to_user_select_text($value) {
	$user = get_user_by('id', (int)$value);
	return array(
		'name' => $user->display_name,
		'id'   => $user->ID,
	);
}

/**
 * Takes the array from user_select_text and returns the id for the database
 * @param array('name' => string, 'id' => int) $value
 * @return int
 */
function user_select_text_to_id($value) {
	return $value['id'];
}

$cmb2->add_field( array(
	// ...snip...
	'escape_cb'       => 'user_select_text_to_id',
	'sanitization_cb' => 'id_to_user_select_text',
) );
```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 64.3% 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 ~116 days

Total

5

Last Release

3266d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/204f41ec695703a1363f27b8e65667efbb491e78a15f5dba772bfce88a7a277b?d=identicon)[jtsternberg](/maintainers/jtsternberg)

---

Top Contributors

[![jtsternberg](https://avatars.githubusercontent.com/u/1098900?v=4)](https://github.com/jtsternberg "jtsternberg (9 commits)")[![tw2113](https://avatars.githubusercontent.com/u/484075?v=4)](https://github.com/tw2113 "tw2113 (3 commits)")[![anhskohbo](https://avatars.githubusercontent.com/u/1529454?v=4)](https://github.com/anhskohbo "anhskohbo (1 commits)")[![Gisleburt](https://avatars.githubusercontent.com/u/2369524?v=4)](https://github.com/Gisleburt "Gisleburt (1 commits)")

---

Tags

wordpressmetaCMB2

### Embed Badge

![Health badge](/badges/webdevstudios-cmb2-user-select/health.svg)

```
[![Health](https://phpackages.com/badges/webdevstudios-cmb2-user-select/health.svg)](https://phpackages.com/packages/webdevstudios-cmb2-user-select)
```

###  Alternatives

[jtsternberg/shortcode-button

Tinymce and Quicktag buttons (and modals) for outputting shortcodes. Built to work with CMB2.

781.3k1](/packages/jtsternberg-shortcode-button)

PHPackages © 2026

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