save_acpt_meta_box
Create or update a meta box
Create or update a meta box.
Usage
save_acpt_meta_box([
'groupName' => 'group',
'name' => 'new-box',
'label' => 'New box',
'new_name' => 'new-box-modified',
'fields' => [
[
'name' => 'field',
'label' => 'Field',
'type' => 'Text',
'show_in_archive' => false,
'is_required' => false,
'default_value' => 'foo',
'description' => 'lorem ipsum dolor facium',
],
],
]);Parameters
Parameter
Type
Required
Description
groupName
string
Required
The field group name (note: unlike most other functions, group_name is not accepted here — only the camelCase key works)
name
string
Required
The meta box name (slug)
new_name
string
Optional
The new box name when renaming an existing box
label
string
Optional
The human-readable box label
fields
array
Optional
Array of field definitions — see save_acpt_meta_field for the field object structure
Return
Type
Description
bool
true on success, false on failure
Last updated