PHPackages                             iamntz/carbon-rest-multiselect - 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. iamntz/carbon-rest-multiselect

ActiveLibrary

iamntz/carbon-rest-multiselect
==============================

carbon rest multiselect

3.0.3(6y ago)12731GPL-2.0+JavaScript

Since Dec 18Pushed 6y ago1 watchersCompare

[ Source](https://github.com/iamntz/carbon-rest-multiselect)[ Packagist](https://packagist.org/packages/iamntz/carbon-rest-multiselect)[ Docs](https://github.com/iamntz/carbon-rest-multiselect)[ RSS](/packages/iamntz-carbon-rest-multiselect/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (5)DependenciesVersions (7)Used By (0)

Carbon Field: `rest_multiselect`
================================

[](#carbon-field-rest_multiselect)

Prov

Adds a `rest_multiselect` field type to Carbon Fields 3. Install using Composer:

```
composer require iamntz/carbon-rest-multiselect:^3.0

```

For Carbon Fields 2 (legacy):

```
composer require iamntz/carbon-rest-multiselect:^2.0

```

Usage:

```
Field::make('rest_multiselect', 'my-name', 'My Label')
  ->set_endpoint( 'base', get_rest_url( null, 'wp/v2/posts' ) )
  ->set_endpoint( 'search', get_rest_url( null, 'wp/v2/posts/?search=' ) )
  ->set_endpoint( 'fetch_by_id', get_rest_url( null, 'wp/v2/posts/?include=' ) ) // endpoint used to look up for saved posts
  ->set_value_key('id') // the REST response key to use as a value in the select
  ->set_selection_limit(999) // what's the maximum amount of selectable items.
  ->set_label_key('title.rendered') // OR
  ->set_label_key(['date', 'title.rendered']) // the REST response key to use as a label in the select
```

**ALL** endpoints are required! If needed, you can specify nonces (or extra variables) directly on the endpoint url: `get_rest_url( null, "wp/v2/posts/?nonce={$generated_nonce}&search=" )`

#### `set_label_key`

[](#set_label_key)

This one is as extensible as it gets: you can use either a string, a dotted string (so it will search for children) or an array that will be combined in to a nicely formatted string.

You can also set some transformations on labels:

```
->set_label_key(['title.rendered|substring:0,10|toUpperCase', 'date|wrap(%label%)']);
```

Basically any JS prototype function that's callable on a string.

There is an exception: you can use a `wrap` transform that will ... well, wrap your label.

#### `set_selection_limit`

[](#set_selection_limit)

You can set what's the maximum amount of selectable items. This will work ad infinitum, without any limit or warning (just like regular HTML `select` tag works). So any new selection will be appended to the existing items, therefore if the limit is reached, then the first element of the selection is lost, the new element will be appended.

Basically if you add `->set_selection_limit(1)` you make the field to behave just like a regular HTML `select`.

#### Return Value

[](#return-value)

The field will *always* return an array of items, with values picked form the key set via `set_value_key('id')` method.

#### Credits

[](#credits)

**Heavily** inspired by @elvishp2006's [awesome plugin](https://github.com/elvishp2006/carbon-field-rest-api-select). Unfortunately, there is no way of extending that one to allow multiple selection without breaking compatibility (different storage and such).

### Support me

[](#support-me)

You can get [hosting](https://m.do.co/c/c95a44d0e992), [donate](https://www.paypal.me/iamntz) or be my [patreon](https://www.patreon.com/iamntz).

### License

[](#license)

The code is released under MIT license.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 87% 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 ~86 days

Recently: every ~56 days

Total

6

Last Release

2266d ago

Major Versions

2.0.0 → 3.0.02019-07-15

### Community

Maintainers

![](https://www.gravatar.com/avatar/5e9ccfed015f7f50e1be8516c662566e7defbcb483b2f0505199912ed3302032?d=identicon)[iamntz](/maintainers/iamntz)

---

Top Contributors

[![iamntz](https://avatars.githubusercontent.com/u/132062?v=4)](https://github.com/iamntz "iamntz (20 commits)")[![alessioalex](https://avatars.githubusercontent.com/u/332898?v=4)](https://github.com/alessioalex "alessioalex (3 commits)")

---

Tags

carbon-fieldscarbon-fields-fieldwordpress-pluginwordpresscarbon-field

### Embed Badge

![Health badge](/badges/iamntz-carbon-rest-multiselect/health.svg)

```
[![Health](https://phpackages.com/badges/iamntz-carbon-rest-multiselect/health.svg)](https://phpackages.com/packages/iamntz-carbon-rest-multiselect)
```

###  Alternatives

[iamntz/carbon-fields-urlpicker

Carbon Fields extension that adds a URL picker field type.

1438.6k](/packages/iamntz-carbon-fields-urlpicker)[htmlburger/carbon-field-icon

Carbon Fields extension, that adds a Icon field type.

198.7k](/packages/htmlburger-carbon-field-icon)

PHPackages © 2026

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