acf_field__group::get_rest_schema
Return the schema array for the REST API.
Method of the class: acf_field__group{}
No Hooks.
Returns
Array.
Usage
$acf_field__group = new acf_field__group(); $acf_field__group->get_rest_schema( $field );
- $field(array) (required)
- .
acf_field__group::get_rest_schema() acf field group::get rest schema code ACF 6.0.4
public function get_rest_schema( array $field ) {
$schema = array(
'type' => array( 'object', 'null' ),
'properties' => array(),
'required' => ! empty( $field['required'] ),
);
foreach ( $field['sub_fields'] as $sub_field ) {
if ( $sub_field_schema = acf_get_field_rest_schema( $sub_field ) ) {
$schema['properties'][ $sub_field['name'] ] = $sub_field_schema;
}
}
return $schema;
}