> For the complete documentation index, see [llms.txt](https://docs.acpt.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.acpt.io/developers/functions/save_acpt_table_group.md).

# save\_acpt\_table\_group

Create or update a Custom Content Type table group

Create or update a table group — the location/visibility rules for a set of [Custom Content Type](/custom-content-types/custom-content-types.md) tables.

Performs an upsert: if a group with the given `name` already exists (and no `id` is passed), its existing state is merged with the ones you provide.

### Usage

```php
save_acpt_table_group([
    'name'  => 'products_group',
    'label' => 'Products group',
    'location' => [
        [
            'rule'     => 'customPostType',
            'value'    => 'page',
            'operator' => '=',
        ],
    ],
]);
```

### Parameters

| Parameter  | Type    | Required | Description                                                                                                     |
| ---------- | ------- | -------- | --------------------------------------------------------------------------------------------------------------- |
| `name`     | string  | Required | Machine name of the table group                                                                                 |
| `id`       | string  | Optional | Existing group UUID (upsert)                                                                                    |
| `label`    | string  | Optional | Human-readable label                                                                                            |
| `display`  | string  | Optional | `standard`, `accordion`, `verticalTabs`, or `horizontalTabs`                                                    |
| `context`  | string  | Optional | Where the group's tables render (mirrors the meta box `context` concept)                                        |
| `priority` | string  | Optional | Rendering priority (mirrors the meta box `priority` concept)                                                    |
| `sort`     | integer | Optional | Sort order among sibling groups                                                                                 |
| `location` | array   | Optional | Location rule definitions (rule/value/operator/logic) controlling which WordPress context this group appears in |
| `tableIds` | array   | Optional | IDs of existing tables to attach to this group                                                                  |

### Return

| Type   | Description                           |
| ------ | ------------------------------------- |
| `bool` | `true` on success, `false` on failure |
