WC_REST_Email_Settings_V4_Controller::get_field_schemaprivateWC 1.0

Get the schema for individual setting fields.

Method of the class: WC_REST_Email_Settings_V4_Controller{}

No Hooks.

Returns

Array.

Usage

// private - for code of main (parent) class only
$result = $this->get_field_schema();

WC_REST_Email_Settings_V4_Controller::get_field_schema() code WC 10.3.6

private function get_field_schema() {
	return array(
		'type'       => 'object',
		'properties' => array(
			'id'          => array(
				'description' => __( 'Setting field ID.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => array( 'view', 'edit' ),
			),
			'label'       => array(
				'description' => __( 'Setting field label.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => array( 'view', 'edit' ),
			),
			'type'        => array(
				'description' => __( 'Setting field type.', 'woocommerce' ),
				'type'        => 'string',
				'enum'        => array( 'text', 'email', 'boolean' ),
				'context'     => array( 'view', 'edit' ),
			),
			'description' => array(
				'description' => __( 'Setting field description.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => array( 'view', 'edit' ),
			),
		),
	);
}