acf_get_field_rest_schema()ACF 1.0

Get the REST API schema for a given field.

Hooks from the function

Returns

Array.

Usage

acf_get_field_rest_schema( $field );
$field(array) (required)
.

acf_get_field_rest_schema() code ACF 6.0.4

function acf_get_field_rest_schema( array $field ) {
	$type   = acf_get_field_type( $field['type'] );
	$schema = array();

	if ( ! is_object( $type ) || ! method_exists( $type, 'get_rest_schema' ) ) {
		return $schema;
	}

	$schema = $type->get_rest_schema( $field );

	/**
	 * Filter the REST API schema for a given field.
	 *
	 * @param array $schema The field schema array.
	 * @param array $field The field array.
	 */
	return (array) apply_filters( 'acf/rest/get_field_schema', $schema, $field );
}