Meta field groups, boxes & fields
Field group, meta box, and meta field definition abilities
Category: acpt-content-model · Default capability: manage_options
ACPT's field system has three nested levels — a field group contains meta boxes, and each box contains meta fields — mirroring the Field groups and The meta fields manager UI. Each level has its own set of abilities.
Field groups
acpt/list-meta-groups
Returns field groups, optionally filtered by name
acpt/get-meta-group
Returns a single field group by name, including its boxes and fields
acpt/save-meta-group
Creates a field group, or updates it if the name already exists
acpt/delete-meta-group
Deletes a field group and everything it contains
acpt/list-meta-groups
Input (all optional)
groupName
string
Filter by group name
$result = wp_get_ability('acpt/list-meta-groups')->execute();acpt/get-meta-group
Input
name
string
Yes
$result = wp_get_ability('acpt/get-meta-group')->execute([
'name' => 'movie-details',
]);belongs describes the group's location rules — where the group is attached. find and operator scope it further (e.g. to a specific post type or term).
acpt/save-meta-group
Input
name
string
Yes
If a group with this name already exists, it's updated instead of duplicated
label
string
No
belongs
array
No
Location rules, see above
boxes
array
No
Full nested boxes/fields definition — you can also manage boxes and fields one at a time with the abilities below instead of resending the whole tree
acpt/delete-meta-group
Input
name
string
Yes
Meta boxes
acpt/list-meta-boxes
Returns the boxes in a given field group
acpt/get-meta-box
Returns a single box by name, including its fields
acpt/save-meta-box
Creates a box inside a group, or updates it if the name already exists in that group
acpt/delete-meta-box
Deletes a box (and its fields) from a group
acpt/list-meta-boxes
Input
group_name
string
Yes
acpt/get-meta-box
Input
name
string
Yes
acpt/save-meta-box
Input
groupName
string
Yes
The field group this box belongs to
name
string
Yes
If a box with this name already exists in that group, it's updated instead of duplicated
new_name
string
No
Renames the box
label
string
No
acpt/delete-meta-box
Input
group_name
string
Yes
name
string
Yes
Meta fields
acpt/list-meta-fields
Returns the field definitions attached to a given location
acpt/get-meta-field
Returns a single field definition by box name and field name
acpt/save-meta-field
Creates a field inside a box, or updates it if the name already exists in that box
acpt/delete-meta-field
Deletes a field definition from a box
acpt/list-meta-fields
Unlike the other list abilities, this one is scoped by location rather than returning everything — it mirrors get_acpt_meta_field_objects().
Input
belongsTo
string
Yes
The location type these fields belong to (e.g. a custom post type, taxonomy, user, or option page identifier)
find
string
No
Restrict to a specific location slug/id within belongsTo
clonedFields
boolean
No
acpt/get-meta-field
Input
box_name
string
Yes
field_name
string
Yes
acpt/save-meta-field
Input
groupName
string
Yes
The field group this field belongs to
boxName
string
Yes
The meta box this field belongs to
name
string
Yes
If a field with this name already exists in that box, it's updated instead of duplicated
type
string
Yes
One of ACPT's field types, written exactly as ACPT names it (case-sensitive): Text, Textarea, Number, Date, Image, Select, Repeater, FlexibleContent, Post (relational), …
label
string
No
The field's label
new_name
string
No
Renames the field
parentName
string
No
Nests this field as a child of an existing Repeater/List field
defaultValue
string|null
No
description
string
No
isRequired
boolean
No
showInArchive
boolean
No
children
array
No
Nested field definitions, for Repeater/List fields
blocks
array
No
Nested block definitions, for Flexible Content fields
acpt/delete-meta-field
Input
group_name
string
Yes
box_name
string
Yes
field_name
string
Yes
Last updated