{"id":13810293,"url":"https://github.com/CMB2/cmb2-attached-posts","last_synced_at":"2025-05-14T10:32:50.031Z","repository":{"id":15219215,"uuid":"17947753","full_name":"CMB2/cmb2-attached-posts","owner":"CMB2","description":"Custom field for CMB2 for attaching posts to a page.","archived":false,"fork":false,"pushed_at":"2023-07-21T18:02:29.000Z","size":574,"stargazers_count":135,"open_issues_count":31,"forks_count":61,"subscribers_count":39,"default_branch":"master","last_synced_at":"2025-05-09T10:29:01.047Z","etag":null,"topics":["cmb2","cmb2-attached-posts","php","wordpress"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CMB2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2014-03-20T15:30:07.000Z","updated_at":"2024-08-28T18:45:28.000Z","dependencies_parsed_at":"2023-01-13T18:19:03.528Z","dependency_job_id":"fad3bb59-c718-45c9-b372-6108328600b0","html_url":"https://github.com/CMB2/cmb2-attached-posts","commit_stats":{"total_commits":86,"total_committers":21,"mean_commits":4.095238095238095,"dds":0.5116279069767442,"last_synced_commit":"be85d168be21d748f3b17252a8ad5497737c7660"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CMB2%2Fcmb2-attached-posts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CMB2%2Fcmb2-attached-posts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CMB2%2Fcmb2-attached-posts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CMB2%2Fcmb2-attached-posts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CMB2","download_url":"https://codeload.github.com/CMB2/cmb2-attached-posts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254020859,"owners_count":22000800,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cmb2","cmb2-attached-posts","php","wordpress"],"created_at":"2024-08-04T02:00:50.003Z","updated_at":"2025-05-14T10:32:49.992Z","avatar_url":"https://github.com/CMB2.png","language":"PHP","readme":"CMB2 Attached Posts Field\n==================\n\nCustom field for [CMB2](https://github.com/WebDevStudios/CMB2).\n\nThe 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).\n\n## Installation\n\nFollow 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).\n\n## Customization\nThe 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.\n\n## Usage\nYou can retrieve the meta data using the following:\n\n```php\n$attached = get_post_meta( get_the_ID(), '_attached_cmb2_attached_posts', true );\n```\n\nThis will return an array of attached post IDs. You can loop through those post IDs like the following example:\n\n```php\nforeach ( $attached as $attached_post ) {\n\t$post = get_post( $attached_post );\n}\n```\n\nOnce you have the post data for the post ID, you can proceed with the desired functionality relating to each attached post.\n\n\n## Screenshots\n\n1. Field display  \n![Field display](https://raw.githubusercontent.com/WebDevStudios/cmb2-attached-posts/master/attached-posts-field.png)`\n\n1. Post search  \n![Post search](https://raw.githubusercontent.com/WebDevStudios/cmb2-attached-posts/master/attached-posts-search.gif)`\n\n## Changelog\n\n### 1.2.7\n* Add default column display output. Simply add `'column' =\u003e true,` to your field registration.\n\n### 1.2.6\n* Add post type label next to post title when multiple post-types are specified in the query args.\n* 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).\n\n### 1.2.5\n* 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)).\n\n### 1.2.4\n* 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)).\n\n### 1.2.3\n* Add loader to manage loading the most recent version of this lib.\n\n### 1.2.2\n* Allow array of post-types. Props [@mmcachran](https://github.com/mmcachran).\n\n### 1.2.1\n* Add Search Filter Boxes to Lists. Props [@owenconti](https://github.com/owenconti).\n\n### 1.2.0\n* Add plugin support. Props [@yelly](https://github.com/yelly).\n","funding_links":[],"categories":["WordPress Plugins"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCMB2%2Fcmb2-attached-posts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCMB2%2Fcmb2-attached-posts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCMB2%2Fcmb2-attached-posts/lists"}