alleyinteractive / alleyinteractive/wordpress-fieldmanager
Allow non-identical child fields to be sortable
- 主要語言
- PHP
- 星號
- 563
- 分支
- 99
- PR 合併指標
- 30 天內沒有已合併 PR
描述
Currently, Fieldmanager is unable to sort unique fields within a group.
In the following example, the children of `example_group` are not sortable:
``` php
$fm = new Fieldmanager_Group( array(
'name' => 'example_group',
'label' => __( 'Example group', 'namespace' ),
'sortable' => true,
'children' => array(
'unique_child_one' => new Fieldmanager_Group( array(
'label' => __( 'Child One', 'namespace' ),
'sortable' => true,
'children' => array(
// etc.
),
) ),
'unique_child_two' => new Fieldmanager_Group( array(
'label' => __( 'Child Two', 'namespace' ),
'sortable' => true,
'children' => array(
// etc.
),
) ),
'unique_child_three' => new Fieldmanager_Group( array(
'label' => __( 'Child Three', 'namespace' ),
'sortable' => true,
'children' => array(
// etc.
),
) ),
),
) );
```
A pair of workarounds are possible: one could create a separate sorting field, or potentially use identical repeating groups and use a select menu to set whatever unique value is required. But in some cases, I think it may be desirable to structure a field as I have in the above example.
It's also worth noting the UI for the above example sort of suggests that the fields are sortable: one can click and drag each unique FM group, but can't actually adjust the order of those groups.
貢獻指南
評估
這個 Issue 還沒有評估資料。