metaboxMeta Box Abilities
Custom fields integration. Structured meta beyond the core post fields.
edit_posts 4Available Tools (4)
mb_get_fieldedit_postsGet a single Meta Box field value from a post, hydrated per field type (image fields as attachment data, group/cloneable fields as nested structures, etc.). Use this instead of wp_get_post_meta when Meta Box is active: the raw meta API returns the serialized storage, this returns the value the Meta Box editor shows.
Parameter Schema2 parameters
{
"type": "object",
"properties": {
"post_id": {
"type": "integer",
"description": "Post the field belongs to."
},
"field_id": {
"type": "string",
"description": "Meta Box field id."
}
},
"required": [
"post_id",
"field_id"
]
}mb_get_fieldsedit_postsRead every Meta Box field registered for a post's post type, hydrated. Discovery + read in one call. Read-only.
Parameter Schema1 parameter
{
"type": "object",
"properties": {
"post_id": {
"type": "integer",
"description": "Post to read fields from."
}
},
"required": [
"post_id"
]
}mb_update_fieldedit_postsWrite one Meta Box field value on a post through Meta Box's own setter (rwmb_set_meta), so the value is stored the way Meta Box expects for that field type. Requires edit permission on the post. Emits an undo token restoring the prior value.
Parameter Schema3 parameters
{
"type": "object",
"properties": {
"post_id": {
"type": "integer"
},
"field_id": {
"type": "string"
},
"value": {
"description": "New value. Shape depends on the field type; for simple fields a scalar, for others the structure Meta Box stores."
}
},
"required": [
"post_id",
"field_id",
"value"
]
}mb_get_field_groupsedit_postsEnumerate registered Meta Box fields grouped by the post type they attach to: field id, name/label, and type. Optionally filter to one post type. Read-only discovery.
Parameter Schema1 parameter
{
"type": "object",
"properties": {
"post_type": {
"type": "string",
"description": "Optional post-type slug to filter to."
}
}
}