PHPackages                             cehojac/attached-posts - 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. cehojac/attached-posts

ActiveWordpress-plugin

cehojac/attached-posts
======================

Custom field for CMB2 for creating post relationships.

v1.2.7(8y ago)06GPL-2.0+PHPPHP &gt;5.2.4

Since Mar 27Pushed 5y ago1 watchersCompare

[ Source](https://github.com/cehojac/cmb2-attached-posts-2)[ Packagist](https://packagist.org/packages/cehojac/attached-posts)[ Docs](https://github.com/WebDevStudios/CMB2)[ RSS](/packages/cehojac-attached-posts/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependenciesVersions (8)Used By (0)

CMB2 Attached Posts Field
=========================

[](#cmb2-attached-posts-field)

Custom field for [CMB2](https://github.com/WebDevStudios/CMB2).

The post IDs are saved in an array, which can be rearranged by dragging and dropping posts in the attached posts column. Now incorporates the same search field as the [CMB2 Post Search field](https://github.com/WebDevStudios/CMB2-Post-Search-field).

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

[](#installation)

Follow the example in [`example-field-setup.php`](https://github.com/WebDevStudios/cmb2-attached-posts/blob/master/example-field-setup.php) for a demonstration. The example assumes you have both CMB2 and this extension in your mu-plugins directory. If you're using CMB2 installed as a plugin, remove [lines 6-9 of the example](https://github.com/WebDevStudios/cmb2-attached-posts/blob/master/example-field-setup.php#L6-L9).

Customization
-------------

[](#customization)

The example demonstrates how to modify the `get_posts` query args, and allows you to toggle the thumbnails display as well as a filter search input.

Usage
-----

[](#usage)

You can retrieve the meta data using the following:

```
$attached = get_post_meta( get_the_ID(), '_attached_cmb2_attached_posts', true );
```

This will return an array of attached post IDs. You can loop through those post IDs like the following example:

```
foreach ( $attached as $attached_post ) {
	$post = get_post( $attached_post );
}
```

Once you have the post data for the post ID, you can proceed with the desired functionality relating to each attached post.

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

[](#screenshots)

1. Field display
    [![Field display](https://raw.githubusercontent.com/WebDevStudios/cmb2-attached-posts/master/attached-posts-field.png)](https://raw.githubusercontent.com/WebDevStudios/cmb2-attached-posts/master/attached-posts-field.png)`
2. Post search
    [![Post search](https://raw.githubusercontent.com/WebDevStudios/cmb2-attached-posts/master/attached-posts-search.gif)](https://raw.githubusercontent.com/WebDevStudios/cmb2-attached-posts/master/attached-posts-search.gif)`

Changelog
---------

[](#changelog)

### 1.2.7

[](#127)

- Add default column display output. Simply add `'column' => true,` to your field registration.

### 1.2.6

[](#126)

- Add post type label next to post title when multiple post-types are specified in the query args.
- Open attached-posts links in new window, so as not to leave the current editing window. Props [Shelob9](https://github.com/Shelob9), [\#37](https://github.com/WebDevStudios/cmb2-attached-posts/pull/37), [\#36](https://github.com/CMB2/cmb2-attached-posts/issues/36).

### 1.2.5

[](#125)

- Combined the best bits from the [CMB2 Post Search field](https://github.com/WebDevStudios/CMB2-Post-Search-field) type and this field type, so now you can search for additional posts/pages/etc to be attached. User search is not currently supported. ([\#7](https://github.com/WebDevStudios/cmb2-attached-posts/pull/7)).

### 1.2.4

[](#124)

- Add support for attaching Users instead of Posts/Custom Posts. Props [mckernanin](https://github.com/mckernanin) ([\#27](https://github.com/WebDevStudios/cmb2-attached-posts/pull/27)).

### 1.2.3

[](#123)

- Add loader to manage loading the most recent version of this lib.

### 1.2.2

[](#122)

- Allow array of post-types. Props [@mmcachran](https://github.com/mmcachran).

### 1.2.1

[](#121)

- Add Search Filter Boxes to Lists. Props [@owenconti](https://github.com/owenconti).

### 1.2.0

[](#120)

- Add plugin support. Props [@yelly](https://github.com/yelly).

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 66.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 ~148 days

Total

5

Last Release

3110d ago

### Community

Maintainers

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

---

Top Contributors

[![jtsternberg](https://avatars.githubusercontent.com/u/1098900?v=4)](https://github.com/jtsternberg "jtsternberg (58 commits)")[![mckernanin](https://avatars.githubusercontent.com/u/6300047?v=4)](https://github.com/mckernanin "mckernanin (6 commits)")[![coreymcollins](https://avatars.githubusercontent.com/u/954724?v=4)](https://github.com/coreymcollins "coreymcollins (4 commits)")[![cehojac](https://avatars.githubusercontent.com/u/1319696?v=4)](https://github.com/cehojac "cehojac (3 commits)")[![mmcachran](https://avatars.githubusercontent.com/u/375068?v=4)](https://github.com/mmcachran "mmcachran (3 commits)")[![CamdenSegal](https://avatars.githubusercontent.com/u/804253?v=4)](https://github.com/CamdenSegal "CamdenSegal (2 commits)")[![clifgriffin](https://avatars.githubusercontent.com/u/682201?v=4)](https://github.com/clifgriffin "clifgriffin (2 commits)")[![mixcas](https://avatars.githubusercontent.com/u/1994425?v=4)](https://github.com/mixcas "mixcas (2 commits)")[![yelly](https://avatars.githubusercontent.com/u/1666471?v=4)](https://github.com/yelly "yelly (2 commits)")[![Shelob9](https://avatars.githubusercontent.com/u/1994311?v=4)](https://github.com/Shelob9 "Shelob9 (1 commits)")[![johnnypea](https://avatars.githubusercontent.com/u/169748?v=4)](https://github.com/johnnypea "johnnypea (1 commits)")[![pbearne](https://avatars.githubusercontent.com/u/46270?v=4)](https://github.com/pbearne "pbearne (1 commits)")[![lukasbesch](https://avatars.githubusercontent.com/u/241689?v=4)](https://github.com/lukasbesch "lukasbesch (1 commits)")[![lmartins](https://avatars.githubusercontent.com/u/151981?v=4)](https://github.com/lmartins "lmartins (1 commits)")

---

Tags

pluginwordpresspostrelationshipmetaboxattached

### Embed Badge

![Health badge](/badges/cehojac-attached-posts/health.svg)

```
[![Health](https://phpackages.com/badges/cehojac-attached-posts/health.svg)](https://phpackages.com/packages/cehojac-attached-posts)
```

###  Alternatives

[webdevstudios/cmb2-attached-posts

Custom field for CMB2 for creating post relationships.

13565.5k](/packages/webdevstudios-cmb2-attached-posts)[cmb2/cmb2

CMB2 is a metabox, custom fields, and forms library for WordPress that will blow your mind.

3.0k640.4k23](/packages/cmb2-cmb2)[alexis-magina/cmb2-field-post-search-ajax

CMB2 field type to attach posts to each others. Search with Ajax.

3913.4k1](/packages/alexis-magina-cmb2-field-post-search-ajax)[sybrew/the-seo-framework

An automated, advanced, accessible, unbranded and extremely fast SEO solution for any WordPress website.

47078.8k](/packages/sybrew-the-seo-framework)[afragen/git-updater

A plugin to automatically update GitHub, Bitbucket, GitLab, or Gitea hosted plugins, themes, and language packs.

3.3k1.6k](/packages/afragen-git-updater)[webdevstudios/cmb2-post-search-field

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

6647.7k2](/packages/webdevstudios-cmb2-post-search-field)

PHPackages © 2026

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