WP_REST_View_Config_Controller::get_form_field_schema
Returns the schema for a form field item (string or object).
Метод класса: WP_REST_View_Config_Controller{}
Хуков нет.
Возвращает
array. Schema for a form field.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->get_form_field_schema();
Список изменений
| С версии 7.1.0 | Введена. |
Код WP_REST_View_Config_Controller::get_form_field_schema() WP REST View Config Controller::get form field schema WP 7.1.2
protected function get_form_field_schema() {
return array(
'oneOf' => array(
array( 'type' => 'string' ),
array(
'type' => 'object',
'properties' => array(
'id' => array(
'type' => 'string',
),
'label' => array(
'type' => 'string',
),
'description' => array(
'type' => 'string',
),
'layout' => $this->get_form_layout_schema(),
'children' => array(
'type' => 'array',
'items' => array(
'oneOf' => array(
array( 'type' => 'string' ),
// This object can have the shape of a form field itself,
// allowing for recursive nesting of form fields.
// There's no easy way to codify this recursion via the JSON Schema draft-04
// supported by the REST API.
array( 'type' => 'object' ),
),
),
),
),
),
),
);
}