acf_field_gallery::get_rest_schemapublicACF 1.0

Return the schema array for the REST API.

Method of the class: acf_field_gallery{}

No Hooks.

Returns

Array.

Usage

$acf_field_gallery = new acf_field_gallery();
$acf_field_gallery->get_rest_schema( $field );
$field(array) (required)
.

acf_field_gallery::get_rest_schema() code ACF 6.8.8

public function get_rest_schema( array $field ) {
	$schema = array(
		'type'     => array( 'array', 'null' ),
		'required' => ! empty( $field['required'] ),
		'items'    => array(
			'type' => 'number',
		),
	);

	if ( ! empty( $field['min'] ) ) {
		$schema['minItems'] = (int) $field['min'];
	}

	if ( ! empty( $field['max'] ) ) {
		$schema['maxItems'] = (int) $field['max'];
	}

	return $schema;
}