-
Notifications
You must be signed in to change notification settings - Fork 566
Closed
Description
Issue:
I have a CPT which is just title, excerpt and a CMB metabox containing a repeatable group field.
In this situation, remove doesn't work on group field -- throws a JS error in cmb2.min.js:
Line 382 ReferenceError: Can't find variable: tinyMCE
With a WYSIWYG editor present on the CPT, remove on the group field works as expected.
CMB2 Field Registration Code:
$args = array(
'labels' => $labels,
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'query_var' => true,
'rewrite' => array('slug' => 'slider'),
'capability_type' => 'post',
'hierarchical' => false,
'menu_icon' => 'dashicons-images-alt',
'has_archive' => true,
'supports' => array( 'title', 'excerpt', 'thumbnail'),
'taxonomies' => array()
);
register_post_type( 'a21_slider' , $args );
....
$prefix = '_a21_slider_';
$slides_box = new_cmb2_box( array(
'id' => $prefix . 'slides',
'title' => __( 'Slides', 'a21-slider' ),
'object_types' => array( 'a21_slider' ),
'context' => 'normal',
'priority' => 'default',
'show_names' => true
));
$slides_group = $slides_box->add_field( array(
'id' => $prefix . 'slides',
'type' => 'group',
'description' => __( 'Select your slides', 'a21-slider' ),
'options' => array(
'group_title' => __( 'Slide {#}', 'a21-slider' ),
'add_button' => __( 'Add Another Slide', 'a21-slider' ),
'remove_button' => __( 'Remove Slide', 'cmb2' ),
'sortable' => true,
),
) );
$slides_box->add_group_field( $slides_group, array(
'name' => __( 'Slide', 'a21-slider' ),
'id' => $prefix . 'slide',
'type' => 'file'
) );
}Metadata
Metadata
Assignees
Labels
No labels