-
Notifications
You must be signed in to change notification settings - Fork 97
Open
Labels
bugSomething isn't workingSomething isn't workingjavascriptRequires understanding JavaScriptRequires understanding JavaScriptscope:display-ifuxDesigning and implementing user experience improvementsDesigning and implementing user experience improvements
Description
Description of the bug
As titled.
Steps To Reproduce
function add_custom_meta_boxes() {
$custom_meta_group = new Fieldmanager_Group(
array(
'name' => 'custom_group',
'children' => array(
'meta' => new Fieldmanager_Checkbox(
[
'save_empty' => false,
'checked_value' => 'meta',
'label' => 'Checkbox',
]
),
'subject_prefix' => new Fieldmanager_Select(
[
'name' => 'subject_prefix',
'label' => 'Subject prefix',
'options' => [
'none' => 'None',
'custom' => 'Custom',
],
'default_value' => 'none',
'display_if' => [ // <--- this field requires the `meta` field to be active.
'src' => 'meta',
'value' => 'meta',
],
]
),
'subject_prefix_custom' => new Fieldmanager_Textfield(
[
'label' => 'Custom subject prefix',
'display_if' => [ // <--- this field requires the `subject_prefix` field to be active and indirectly, the `meta` field too.
'src' => 'subject_prefix',
'value' => 'custom',
],
]
),
),
)
);
// Add the group to a post type
$custom_meta_group->add_meta_box( 'Custom Meta', 'your-post-type', 'normal', 'high' );
}
add_action( 'admin_init', 'add_custom_meta_boxes' );CleanShot.2024-07-24.at.00.12.42-converted.mp4
Additional Information
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingjavascriptRequires understanding JavaScriptRequires understanding JavaScriptscope:display-ifuxDesigning and implementing user experience improvementsDesigning and implementing user experience improvements