Deprecated with Papi 3.2.0+
Add-on for the WordPress REST API, requires Papi 3.0.0.
Post types that has page types will get addtional field attached to the object with the fields
that contains all fields for the the current post page type. This can be removed.
Example response with additional fields
field:
[
{
"id": 1,
"fields": {
"name": "Fredrik"
}
}
]
[
{
"id": 1,
"page_type": "example-page-type"
}
]
GET /wp-json/papi/v1/fields/{id}
Get all page types properties on a post.
POST/PUT/PATCH /wp-json/papi/v1/fields/{id}
Update multiple property values.
{
"properties": [
{
"slug": "name",
"value": "Fredrik"
}
]
}
GET /wp-json/papi/v1/fields/{id}/{slug}
Get a single page type property on a post.
POST/PUT/PATCH /wp-json/papi/v1/fields/{id}/{slug}
Update a single page type property value on a post.
{
"value": "Fredrik"
}
DELETE /wp-json/papi/v1/fields/{id}
Delete multiple property values.
{
"properties": [
{
"slug": "name"
}
]
}
DELETE /wp-json/papi/v1/fields/{id}/{slug}
Delete a single page type property value on a post.
GET /wp-json/papi/v1/options
Get all option types properties.
POST/PUT/PATCH /wp-json/papi/v1/options
Update multiple property values.
{
"properties": [
{
"slug": "name",
"value": "Fredrik"
}
]
}
GET /wp-json/papi/v1/options/{slug}
Get a single option type property.
POST/PUT/PATCH /wp-json/papi/v1/options/{slug}
Update a single option type property value.
{
"value": "Fredrik"
}
DELETE /wp-json/papi/v1/options
Delete multiple property values.
{
"properties": [
{
"slug": "name"
}
]
}
DELETE /wp-json/papi/v1/options/{slug}
Delete a single option type property value.
papi/rest/prepare_property_item
- Modify the property item that is returned to the REST API.
MIT © Fredrik Forsmo