PHPackages                             webdevstudios/cmb2-post-search-field - 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. [Search &amp; Filtering](/categories/search)
4. /
5. webdevstudios/cmb2-post-search-field

ActiveWordpress-plugin[Search &amp; Filtering](/categories/search)

webdevstudios/cmb2-post-search-field
====================================

Custom field for CMB2 which adds a post-search dialog for searching/attaching other post IDs.

v0.2.5(9y ago)6647.7k↑11.1%25[15 issues](https://github.com/WebDevStudios/CMB2-Post-Search-field/issues)2GPL-2.0+PHPPHP &gt;5.2.4

Since Mar 28Pushed 7y ago33 watchersCompare

[ Source](https://github.com/WebDevStudios/CMB2-Post-Search-field)[ Packagist](https://packagist.org/packages/webdevstudios/cmb2-post-search-field)[ Docs](https://github.com/WebDevStudios/CMB2)[ RSS](/packages/webdevstudios-cmb2-post-search-field/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (4)Used By (2)

CMB2 Post Search field
======================

[](#cmb2-post-search-field)

Custom field for CMB2 which adds a post-search dialog for searching/attaching other post IDs.

Adds a new text field type (with a button), `post_search_text` that adds a quick post search dialog for saving post IDs to a text input.

Example
-------

[](#example)

```
// Classic CMB2 declaration
$cmb = new_cmb2_box( array(
	'id'           => 'prefix-metabox-id',
	'title'        => __( 'Post Info' ),
	'object_types' => array( 'post', ), // Post type
) );

// Add new field
$cmb->add_field( array(
	'name'        => __( 'Related post' ),
	'id'          => 'prefix_related_post',
	'type'        => 'post_search_text', // This field type
	// post type also as array
	'post_type'   => 'post',
	// Default is 'checkbox', used in the modal view to select the post type
	'select_type' => 'radio',
	// Will replace any selection with selection from modal. Default is 'add'
	'select_behavior' => 'replace',
) );
```

Screenshots
-----------

[](#screenshots)

1. Field display
    [![Field display](https://raw.githubusercontent.com/WebDevStudios/CMB2-Post-Search-field/master/post-search-field.png)](https://raw.githubusercontent.com/WebDevStudios/CMB2-Post-Search-field/master/post-search-field.png)
2. Search Modal
    [![Search Modal](https://raw.githubusercontent.com/WebDevStudios/CMB2-Post-Search-field/master/post-search-dialog.png)](https://raw.githubusercontent.com/WebDevStudios/CMB2-Post-Search-field/master/post-search-dialog.png)

---

If you're looking for a more general way to attach posts (or other custom post types) with a drag and drop interface, you might consider [CMB2 Attached Posts Field](https://github.com/WebDevStudios/cmb2-attached-posts) instead.

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity43

Moderate usage in the ecosystem

Community25

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 91.7% 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 ~63 days

Total

2

Last Release

3638d 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 (44 commits)")[![ravinderk](https://avatars.githubusercontent.com/u/1784821?v=4)](https://github.com/ravinderk "ravinderk (2 commits)")[![davidrgreen](https://avatars.githubusercontent.com/u/5841903?v=4)](https://github.com/davidrgreen "davidrgreen (1 commits)")[![Mte90](https://avatars.githubusercontent.com/u/403283?v=4)](https://github.com/Mte90 "Mte90 (1 commits)")

---

Tags

cmb2phpwordpresspluginsearchwordpressfieldmetabox

### Embed Badge

![Health badge](/badges/webdevstudios-cmb2-post-search-field/health.svg)

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

###  Alternatives

[10up/elasticpress

Supercharge WordPress with Elasticsearch.

1.3k374.3k6](/packages/10up-elasticpress)[10up/debug-bar-elasticpress

Extends the Debug Bar plugin for usage with ElasticPress

2917.0k](/packages/10up-debug-bar-elasticpress)[marcorieser/statamic-live-search

A Statamic Live Search realized with Laravel Livewire.

2210.5k](/packages/marcorieser-statamic-live-search)

PHPackages © 2026

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