Core Function
View Source on Trac ↗ register_rest_field()
register_rest_field( mixed $object_type, mixed $attribute, mixed $args = array() ) Registers a new field on an existing WordPress object type.
Parameters 3 required
| Name / Type | Description |
|---|---|
| mixed | (string | array) $object_type Object(s) the field is being registered to, "post"|"term"|"comment" etc. Required |
| $attribute string | The attribute name. Required |
| array | $args { Optional. An array of arguments used to handle the registered field. Required |
Return Value
(void)
No return value description available.
Function Information
Since Version
4.7.0
Source File
wp-includes/rest-api.php
Advertisement