Get expected value format for a field is a WordPress ability from Meta Box — usable via Easy MCP AI, which connects Claude, ChatGPT, and any AI assistant to your site.

Install Free Plugin →

Get expected value format for a field

Read-only
Meta Box Content & Tools meta-box/get-field-value-format

Look up the expected value format and a worked example for a Meta Box field type, or for one specific field.

Requires the Meta Box plugin on WordPress 6.9+ for the Abilities API (abilities are registered only when the wp_register_ability() function exists). The get, update, and delete abilities additionally require the target key to be a field Meta Box actually recognizes (verified via rwmb_get_field_settings) and the current user to hold the WordPress capability mapped from object_type: read_post/edit_post for posts, assign_term/edit_term for terms, read/edit_user for users, read/manage_options for settings pages, and read/moderate_comments for comments.

What it does

This ability tells you what shape of value a Meta Box field expects before you try to read or write it. Call it with just field_type (e.g. "checkbox_list", "background", "date") for generic type-level info, or with field_id plus object_id (and optionally object_type) to resolve the actual registered field and get precise info that accounts for its multiple and clone settings — since a field with multiple=true or clone=true wraps its value in an array, or a nested array of arrays when both are set. It's meant to be called before update-field-value so an AI assistant sends the value in exactly the shape Meta Box expects, instead of guessing and getting a silently-wrong save.

See it in action

You ask your AI assistant

"Before I update it, tell me what value format the 'gallery' field on post 128 expects — is it a single value or an array?"

Inputs

Name Type Required Description
field_type string No Meta Box field type slug (e.g. "checkbox_list", "date", "background"). Alternative to field_id.
field_id string No Field meta key. When given, resolves the field's real settings (multiple/clone) for a precise format.
object_id integer|string No Object ID (post, term, user ID, or settings page slug). Required when field_id is given.
object_type string No Object type: post, term, user, setting, or comment. Defaults to post. Used together with field_id.

Returns

An object with the field_type, a human-readable format description, an example value, an is_array flag, an is_multiple flag, an is_cloneable flag (both false when only field_type is given), and a value_structure of scalar, array, or array_of_arrays describing the overall value shape.

Permission

When field_id and object_id are both given, the current user must hold the capability mapped from object_type for the update verb (e.g. edit_post for posts, edit_term for terms). When only field_type is given, any user with the base 'read' capability may call it.

Newsletter

The AI + WordPress space moves fast. Keep up.

New tools, workflow ideas, and product updates — be the first to know what's next.

No spam, unsubscribe anytime.