{"id":19238021,"url":"https://github.com/cmb2/cmb2-group-map","last_synced_at":"2025-07-24T09:34:26.456Z","repository":{"id":79086160,"uuid":"79810368","full_name":"CMB2/cmb2-group-map","owner":"CMB2","description":"Originally created for Post Status (https://poststatus.com/) to associate footnotes with notes, This CMB2 addon allows you to use CMB2 group fields to manage custom post type entries.","archived":false,"fork":false,"pushed_at":"2017-01-23T14:41:52.000Z","size":456,"stargazers_count":14,"open_issues_count":0,"forks_count":2,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-07-19T12:27:13.047Z","etag":null,"topics":["cmb2","cmb2-addon","wordpress"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"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":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-01-23T14:13:24.000Z","updated_at":"2024-05-29T15:58:43.000Z","dependencies_parsed_at":"2023-05-31T13:30:53.024Z","dependency_job_id":null,"html_url":"https://github.com/CMB2/cmb2-group-map","commit_stats":{"total_commits":46,"total_committers":1,"mean_commits":46.0,"dds":0.0,"last_synced_commit":"2799262d47ef36765717aac003bb86193f27422f"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/CMB2/cmb2-group-map","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CMB2%2Fcmb2-group-map","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CMB2%2Fcmb2-group-map/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CMB2%2Fcmb2-group-map/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CMB2%2Fcmb2-group-map/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CMB2","download_url":"https://codeload.github.com/CMB2/cmb2-group-map/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CMB2%2Fcmb2-group-map/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266822007,"owners_count":23989821,"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","status":"online","status_checked_at":"2025-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-addon","wordpress"],"created_at":"2024-11-09T16:29:03.803Z","updated_at":"2025-07-24T09:34:24.894Z","avatar_url":"https://github.com/CMB2.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"CMB2 Group Map\n======================\n\nOriginally created for [Post Status](https://poststatus.com/) to associate footnotes with notes, This CMB2 addon allows you to use CMB2 group fields to manage custom post type entries.\n\nYou will either need to clone and then run `composer install` in this plugin's directory to get the required dependencies, or simply [download the compiled zip](https://github.com/zao-web/cmb2-group-map/raw/master/cmb2-group-map.zip).\n\nA few details:\n\n* To specify the post type destination, add a `'post_type_map'` parameter to your group field parameters.\n* To set the default WordPress post fields (e.g. the post content, title, etc), you need to set the `'id'` parameter to the same value as the `wp_posts` database column name. So for the content,  the `'id'` parameter would be `'post_content'`, or for the title, `'post_title'`.\n* To set taxonomy terms for the connected post-type posts, use one of the `taxonomy_*` field types.\n\n## Example\n\nYou need to include this library:\n```php\nrequire_once( 'cmb2-group-map/cmb2-group-map.php' );\n```\n\nThen setup a CMB2 metabox with a grouped field:\n```php\n// Standard CMB2 registration.\n$cmb = new_cmb2_box( array(\n\t'id'           =\u003e 'footnotes',\n\t'title'        =\u003e 'Footnotes',\n\t'object_types' =\u003e array( 'post' ),\n) );\n\n// This is our group field registration. It's mostly standard.\n$group_field_id = $cmb-\u003eadd_field( array(\n\t'id'            =\u003e 'footnotes_ids',\n\t'type'          =\u003e 'group',\n\t// This is a custom property, and should specify\n\t// the destination post-type.\n\t'post_type_map' =\u003e 'footnotes',\n\t'description'   =\u003e 'Manage/add connected footnotes',\n\t'options'       =\u003e array(\n\t\t'group_title'   =\u003e 'Footnote {#}',\n\t\t'add_button'    =\u003e 'Add New Footnote',\n\t\t'remove_button' =\u003e 'Remove Footnote',\n\t\t'sortable'      =\u003e true,\n\t),\n) );\n\n// by using 'post_title' as the id, this will be the\n// value stored to the destination post-type's title field.\n$cmb-\u003eadd_group_field( $group_field_id, array(\n\t'name' =\u003e 'Title',\n\t'id'   =\u003e 'post_title',\n\t'type' =\u003e 'text',\n) );\n\n// by using 'post_content' as the id, this will be the\n// value stored to the destination post-type's content field.\n$cmb-\u003eadd_group_field( $group_field_id, array(\n\t'name' =\u003e 'Content',\n\t'id'   =\u003e 'post_content',\n\t'type' =\u003e 'textarea_small',\n) );\n\n// This field will be stored as post-meta against\n// the destination post-type.\n$cmb-\u003eadd_group_field( $group_field_id, array(\n\t'name' =\u003e 'Color meta value',\n\t'id'   =\u003e 'footnote_color',\n\t'type' =\u003e 'colorpicker',\n) );\n\n// This field will be stored as category terms\n// against the destination post-type.\n$cmb-\u003eadd_group_field( $group_field_id, array(\n\t'name'     =\u003e 'Categories',\n\t'id'       =\u003e 'category',\n\t'taxonomy' =\u003e 'category',\n\t'type'     =\u003e 'taxonomy_multicheck',\n) );\n```\n\n## Screenshots\n\n1. Group Field Display  \n![Group Field Display](https://bytebucket.org/jtsternberg/cmb2-group-map/raw/34a20a8e0d31e0e3cc426f50ac05ee5cb19f52ce/screenshot-1.png?token=93e9beb2afc23a2ca5e7f48cf804a2672b60590e)\n\n2. Group pulled from custom-post-type post  \n![Group pulled from custom-post-type post](https://bytebucket.org/jtsternberg/cmb2-group-map/raw/34a20a8e0d31e0e3cc426f50ac05ee5cb19f52ce/screenshot-2.png?token=73ef0c95689064f2ce20990d8153ced4481093ee)\n\n3. Post-select search modal  \n![Post-select search modal](https://bytebucket.org/jtsternberg/cmb2-group-map/raw/34a20a8e0d31e0e3cc426f50ac05ee5cb19f52ce/screenshot-3.png?token=9fce8df6e720382cd5d2145257fe283d372ddd62)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmb2%2Fcmb2-group-map","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcmb2%2Fcmb2-group-map","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmb2%2Fcmb2-group-map/lists"}