fields_create_definition
Creates WordPress field groups, post types, taxonomies, or options page definitions with defaults and key generation, returning the stored definition.
Instructions
Create a definition (field group, post type, taxonomy or options page). The body is the definition itself; omitted keys take the kind's defaults, and a missing key is generated (group_..., post_type_..., taxonomy_..., ui_options_page_...). Fails with 409 when the key exists, 400 when it does not validate. Returns the stored definition (201).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"site": "<site>",
"kind": "<kind>",
"definition": "<definition>"
},
"name": "fields_create_definition"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | Yes | Definition kind: field groups, post types, taxonomies or options pages | |
| site | Yes | Site id (see list_sites) | |
| definition | Yes | Definition object in the shape of fields_get_schema for this kind (ACF-compatible) |