Automattic\WooCommerce\Internal\RestApi\Routes\V4\Settings\Account\Schema
AccountSettingsSchema::get_field_schema
Get the schema for individual setting fields.
Method of the class: AccountSettingsSchema{}
No Hooks.
Returns
Array.
Usage
// private - for code of main (parent) class only $result = $this->get_field_schema(): array;
AccountSettingsSchema::get_field_schema() AccountSettingsSchema::get field schema code WC 10.4.3
private function get_field_schema(): array {
return array(
'type' => 'object',
'properties' => array(
'id' => array(
'description' => __( 'Setting field ID.', 'woocommerce' ),
'type' => 'string',
'context' => self::VIEW_EDIT_CONTEXT,
),
'label' => array(
'description' => __( 'Setting field label.', 'woocommerce' ),
'type' => 'string',
'context' => self::VIEW_EDIT_CONTEXT,
),
'type' => array(
'description' => __( 'Setting field type.', 'woocommerce' ),
'type' => 'string',
'enum' => array( 'text', 'textarea', 'number', 'select', 'multiselect', 'checkbox' ),
'context' => self::VIEW_EDIT_CONTEXT,
),
'options' => array(
'description' => __( 'Available options for select/multiselect fields.', 'woocommerce' ),
'type' => 'object',
'context' => self::VIEW_EDIT_CONTEXT,
),
'desc' => array(
'description' => __( 'Description for the setting field.', 'woocommerce' ),
'type' => 'string',
'context' => self::VIEW_EDIT_CONTEXT,
),
),
);
}