> 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/get_acpt_field_storage_keys.md).

# get\_acpt\_field\_storage\_keys

Get the meta keys a field stores its value under (Public API, level 1)

Get the meta keys a field stores its value under: the main key first, then its extra keys (for example `_type` and `_id`). Part of the [Public API](https://docs.acpt.io/developers/public-api.md) (level 1, ACPT 2.1.10+).

Useful to back up or compare a field's raw stored values before writing with [`bulk_save_acpt_meta_field_values`](https://docs.acpt.io/developers/functions/bulk_save_acpt_meta_field_values.md).

### Usage

```php
$keys = get_acpt_field_storage_keys($fieldId);

if (!is_wp_error($keys)) {
    foreach ($keys as $key) {
        $raw = get_post_meta(12, $key, true);
    }
}
```

### Parameters

| Parameter | Type   | Required | Description  |
| --------- | ------ | -------- | ------------ |
| `fieldId` | string | Required | The field ID |

### Return

| Type             | Description                                                                                       |
| ---------------- | ------------------------------------------------------------------------------------------------- |
| array of strings | The meta keys, main key first, e.g. `['book_box_isbn', 'book_box_isbn_type', 'book_box_isbn_id']` |
| `WP_Error`       | `acpt_unknown_field` when no field has this ID, `acpt_db_error` on an unexpected database failure |
