SIGN IN SIGN UP
payloadcms / payload UNCLAIMED

Payload is the open-source, fullstack Next.js framework, giving you instant backend superpowers. Get a full TypeScript backend and admin panel instantly. Use Payload as a headless CMS or for building powerful applications.

0 0 281 TypeScript

feat!: consolidate admin.disabled field properties (#16504)

Consolidates all `admin.disabled*` field-level properties behind a
single `admin.disabled` property, which now accepts an object.

This is significantly less verbose by allowing a single property to
disable a field _everywhere_, which was not possible before. This
pattern also allows us to continue to extend this config over time,
progressively adding new properties as the UI requires it without
bloating the admin object.

```diff
import type { TextField } from 'payload'

const MyField: TextField = {
  name: 'my-disabled-field',
  type: 'text',
  admin: {
-   disableBulkEdit: true,
-   disableGroupBy: true,
-   disableListColumn: true,
-   disableListFilter: true,
+   disabled: {
+     field: true,
+     column: true,
+     filter: true,
+     groupBy: true,
+     bulkEdit: true
+   }
  }
}
```

To disable a field everywhere, use a boolean value:

```tsx
import type { TextField } from 'payload'

const MyField: TextField = {
  name: 'my-disabled-field',
  type: 'text',
  admin: {
    disabled: true
  }
}
```

#### Codemod

To migrate automatically, there's a codemod for this change available by
running:

```bash
npx @payloadcms/codemod --transform migrate-disabled-fields
```
J
Jake Fletcher committed
9fc219cb3f415984cdc001c5840158432e131b0b
Parent: 24cea90
Committed by GitHub <noreply@github.com> on 5/7/2026, 9:58:54 PM