docs(api-ref): add customFields documentation

This commit is contained in:
nathan-pichon 2023-04-04 10:32:33 +02:00
parent d83a4608b4
commit 456bfd459f
No known key found for this signature in database

View File

@ -183,3 +183,19 @@ By default, the telemetry service is enabled, but you can disable it by setting
The request context stores the ctx object from KoaJS on each request. This allows users to have access to the context from anywhere through the Strapi instance.
### `strapi.customFields`
- <Type>Object</Type>
- `register(customField)`: <Type>Function</Type> Register a new custom field
This property is a shortcut to `strapi.container.get('custom-fields').add(customField)`.
#### Examples
```javascript
strapi.customFields.register({
name: 'color',
plugin: 'color-picker',
type: 'string',
});
```