> 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_meta_field_value.md).

# save\_acpt\_meta\_field\_value

Create or update a meta field value

Create or update a meta field value.

This function replaces the following v1 functions: `add_acpt_meta_field_value`, `edit_acpt_meta_field_value`.

{% hint style="warning" %}
For a **Repeater** field, `value` is the complete, final list of rows — this call replaces the entire stored array, it does not add to it. Sending just one row overwrites the first existing row instead of appending a new one. To add a single row without re-sending the existing ones, use [`append_acpt_meta_field_value()`](/developers/functions/append_acpt_meta_field_value.md) instead.
{% endhint %}

### Usage

```php
save_acpt_meta_field_value([
    'post_id'    => 123,
    'box_name'   => 'box',
    'field_name' => 'field',
    'value'      => 432,
]);
```

### Parameters

| Parameter              | Type    | Required    | Description                                        |
| ---------------------- | ------- | ----------- | -------------------------------------------------- |
| `post_id`              | integer | Conditional | The post ID                                        |
| `term_id`              | integer | Conditional | The term ID                                        |
| `user_id`              | integer | Conditional | The user ID                                        |
| `comment_id`           | integer | Conditional | The comment ID                                     |
| `wc_product_attribute` | integer | Conditional | The WooCommerce product attribute ID               |
| `option_page`          | string  | Conditional | The option page slug                               |
| `box_name`             | string  | Required    | The meta box name                                  |
| `field_name`           | string  | Required    | The field name                                     |
| `value`                | mixed   | Required    | The value to save                                  |
| `forged_by`            | array   | Optional    | Advanced. Used internally to resolve cloned fields |

Exactly one of `post_id`, `term_id`, `user_id`, `comment_id`, `option_page`, or `wc_product_attribute` must be provided to identify the location.

### Return

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