getgrav / getgrav/grav-plugin-admin
onAdminSave should provide field's information
- Dominant language
- PHP
- Stars
- 377
- Forks
- 225
- Avg merge
- 11h 51m
- Merged PRs (30d)
- 4
Description
I've created a custom field intended for admin-side. The value POSTed by the widget is a `JSON.stringify()` in a hidden field, but I want to process it (mostly `json_decode()`).
For this, I hook into `onAdminSave()`.
Eg:
```php
public function onAdminSave(Event $event)
{
if (isset($event['object']->header()->form['field_selection'])) {
$event['object']->header()->form['field_selection'] = json_decode($event['object']->header()->form['field_selection'], true);
}
}
```
But this processing is bound on hardcoding the field **name**. I'd like to be able to process all instance of my-field whatever their name is.
Contributor guide
Assessment
This issue has not been assessed yet.