Skip to content

Meta Box

New in v3.4.2, a community contribution. Meta Box is a developer’s custom-fields toolkit, fast, code-first, and popular for building content models on client sites. EMCP exposes it through two dispatcher tools: read field groups and field values, and update values. Registers only when Meta Box is active.

It’s intentionally conservative, values only. There’s no field authoring and no delete, and unknown fields are skipped rather than created, so an agent can safely fill in and update structured content without risk of scrambling your field definitions.

Both tools take { operation, arguments }. Omit operation to get back the list of available operations for that tool.

Three read operations:

OperationArgumentsWhat it does
list-field-groupssearch?, object_type?List registered field groups (id, title, object type, post types, field count).
get-field-groupidOne field group and its field definitions (label, type, settings).
get-fieldspost_id or object_type + object_id; optional fields, include_field_settingsRead field values from a post or object.

One write operation:

OperationArgumentsWhat it does
update-fieldspost_id or object_type + object_id, fields: { id: value }Write field values on a post or object.

metabox-read is enabled by default. metabox-write ships disabled by default, enable it on EMCP Tools → Tools → Plugins → Meta Box. See Disabling tools.