Support Forum
Support › Meta Box AIO › Metaboxes not saving upon deactivating MetaBox BuilderResolved
hi. as long as I have MetaBox and MetaBox AIO installed, the meta boxes show up fine.
When I deactivate just MetaBox AIO, the meta boxes go away and the groups collapse to just one line...
can you please help?
here is my code:
function nbm_events_create_main_mb( $meta_boxes ) {
$prefix = 'event-';
$meta_boxes[] = array (
'title' => esc_html__( 'Events Metabox', 'nbm-events' ),
'id' => 'nbm_events_main',
'post_types' => array(
0 => 'events',
),
'context' => 'normal',
'priority' => 'high',
'fields' => array(
array (
'id' => $prefix . 'whenwhere',
'type' => 'group',
'name' => esc_html__( 'WHEN & WHERE', 'nbm-events' ),
'fields' => array(
array (
'id' => $prefix . 'start',
'type' => 'datetime',
'name' => esc_html__( 'Event Starts', 'nbm-events' ),
),
array (
'id' => $prefix . 'end',
'type' => 'datetime',
'name' => esc_html__( 'Event Ends', 'nbm-events' ),
),
array (
'id' => $prefix . 'loc-opt',
'name' => esc_html__( 'Radio', 'nbm-events' ),
'type' => 'radio',
'options' => array(
'online' => esc_html__( 'Online', 'nbm-events' ),
'efcc' => esc_html__( 'EFCC', 'nbm-events' ),
'off' => esc_html__( 'Off-Campus', 'nbm-events' ),
),
'required' => 1,
),
array (
'id' => $prefix . 'loc-name',
'type' => 'text',
'name' => esc_html__( 'Location Name', 'nbm-events' ),
'visible' => array(
'when' => array(
array (
0 => 'loc-opt',
1 => '=',
2 => 'off',
),
),
'relation' => 'and',
),
),
array (
'id' => $prefix . 'loc-address',
'type' => 'text',
'name' => esc_html__( 'Address', 'nbm-events' ),
'visible' => array(
'when' => array(
array (
0 => 'loc-opt',
1 => '=',
2 => 'off',
),
),
'relation' => 'and',
),
),
array (
'id' => $prefix . 'loc-bld',
'type' => 'text',
'name' => esc_html__( 'Building / Room #', 'nbm-events' ),
'visible' => array(
'when' => array(
array (
0 => 'loc-opt',
1 => '=',
2 => 'efcc',
),
),
'relation' => 'and',
),
),
),
'default_state' => 'expanded',
'columns' => 4,
),
array (
'id' => $prefix . 'registration',
'type' => 'group',
'name' => esc_html__( 'REGISTRATION', 'nbm-events' ),
'fields' => array(
array (
'id' => $prefix . 'reg-req',
'name' => esc_html__( 'Registration Required?', 'nbm-events' ),
'type' => 'checkbox',
),
array (
'id' => $prefix . 'reg-link',
'type' => 'url',
'name' => esc_html__( 'Registration Link', 'nbm-events' ),
'visible' => array(
'when' => array(
array (
0 => 'reg-req',
1 => '=',
2 => 1,
),
),
'relation' => 'and',
),
),
array (
'id' => $prefix . 'cost-req',
'name' => esc_html__( 'Is there a Cost?', 'nbm-events' ),
'type' => 'checkbox',
),
array (
'id' => $prefix . 'cost',
'type' => 'text',
'name' => esc_html__( 'Cost', 'nbm-events' ),
'visible' => array(
'when' => array(
array (
0 => 'cost-req',
1 => '=',
2 => 1,
),
),
'relation' => 'and',
),
),
),
'default_state' => 'expanded',
'columns' => 4,
),
array (
'id' => $prefix . 'poc',
'type' => 'group',
'name' => esc_html__( 'POINT OF CONTACT', 'nbm-events' ),
'fields' => array(
array (
'id' => $prefix . 'poc-name',
'type' => 'text',
'name' => esc_html__( 'Contact Name', 'nbm-events' ),
),
array (
'id' => $prefix . 'poc-email',
'name' => esc_html__( 'Contact Email', 'nbm-events' ),
'type' => 'email',
),
array (
'id' => $prefix . 'poc-tel',
'type' => 'text',
'name' => esc_html__( 'Contact Number', 'nbm-events' ),
),
),
'default_state' => 'expanded',
'columns' => 4,
),
),
'text_domain' => 'nbm-events',
);
return $meta_boxes;
}
Hi Emily,
If you deactivate the plugin Meta Box AIO, please activate plugins support the feature that you are using in the code
- field group
: activate Meta Box Group plugin.
- conditional logic visible
: activate Meta Box Conditional Logic plugin.
got it. thank you 🙂