Hi,
i have code that works, perfectly in the functions.php, I would like to setup these custom fields via the Metabox backend (graphical backend), Problem I am having is , how do i set and run the function cmb_fields_by_user_role when the box is called in the gfx backend ?
$meta_boxes[] = [
'title' => __('Custom Metabox'),
'id' => 'custom-metabox',
'post_types' => ['cpt'], // CPT
'fields' => cmb_fields_by_user_role([
[
'type' => 'text',
'id' => 'field_1',
'name' => '<h3>Field 1</h3>',
'cmb_role' => array(administrator')
],
[
'type' => 'text',
'id' => 'field_2',
'name' => '<h3>Field 2</h3>',
'cmb_role' => array('author','administrator')
],
[
'type' => 'text',
'id' => 'field_3',
'name' => '<h3>Field 3</h3>',
'cmb_role' => array('administrator')
]